/* modals.css - Modal Styles */

/* Modal Base */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--warm-white);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-pale);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--charcoal);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-pale);
    display: flex;
    gap: 12px;
}

/* Post Creation Modal */
.post-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-md);
    font-size: 15px;
    resize: vertical;
    font-family: inherit;
}

.post-options {
    display: flex;
    gap: 12px;
    margin: 16px 0;
    align-items: center;
}

.post-tag-select {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.add-photo-btn {
    padding: 10px 16px;
    background: var(--gray-pale);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
}

.char-count {
    text-align: right;
    font-size: 13px;
    color: var(--gray-medium);
}

/* Comments Modal */
.comments-modal .modal-content {
    max-width: 400px;
}

.comments-list {
    max-height: 400px;
    overflow-y: auto;
}

.comment {
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-pale);
}

.comment:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--sage-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--sage-dark);
}

.comment-meta {
    flex: 1;
}

.comment-author {
    font-size: 14px;
    font-weight: 500;
    color: var(--charcoal);
}

.comment-time {
    font-size: 12px;
    color: var(--gray-medium);
}

.comment-content {
    font-size: 14px;
    color: var(--gray-dark);
    line-height: 1.5;
}

.comment-input-container {
    display: flex;
    gap: 12px;
    align-items: center;
}

.comment-input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--gray-light);
    border-radius: 20px;
    font-size: 14px;
}

.comment-submit-btn {
    padding: 10px 20px;
    background: var(--sage);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

/* Profile Modal */
.profile-modal .modal-body {
    text-align: center;
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--sage-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--sage-dark);
    margin: 0 auto 16px;
}

.profile-bio {
    font-size: 14px;
    color: var(--gray-medium);
    margin: 12px 0 20px;
}

.profile-stats-row {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin: 20px 0;
}

.profile-stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 20px;
    font-weight: 600;
    color: var(--charcoal);
}

.stat-label {
    font-size: 12px;
    color: var(--gray-medium);
}

.follow-btn {
    padding: 10px 32px;
    background: var(--sage);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 20px;
}

.follow-btn.following {
    background: var(--gray-pale);
    color: var(--charcoal);
}

/* Article Modal */
.article-modal .modal-content {
    max-width: 600px;
}

.article-detail {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.article-header {
    margin-bottom: 24px;
}

.article-category {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--sage);
    font-weight: 500;
    margin-bottom: 8px;
}

.article-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--charcoal);
    line-height: 1.3;
    margin-bottom: 12px;
}

.article-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--gray-medium);
}

.article-body {
    font-size: 16px;
    line-height: 1.8;
    color: var(--gray-dark);
    margin-bottom: 24px;
}

.article-body h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--charcoal);
    margin: 24px 0 12px;
}

.article-body h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--charcoal);
    margin: 20px 0 12px;
}

.article-body p {
    margin-bottom: 16px;
}

.article-body ul, .article-body ol {
    margin: 0 0 16px 24px;
}

.article-body li {
    margin-bottom: 8px;
}

.article-footer {
    border-top: 1px solid var(--gray-pale);
    padding-top: 20px;
    margin-top: auto;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.article-tags .tag {
    padding: 4px 12px;
    background: var(--sage-light);
    color: var(--sage-dark);
    border-radius: 16px;
    font-size: 13px;
}

.article-actions {
    display: flex;
    gap: 12px;
}

.save-article-btn, .share-article-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--gray-light);
    background: var(--warm-white);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.save-article-btn:hover, .share-article-btn:hover {
    background: var(--gray-pale);
}

.ai-btn {
    padding: 8px 16px;
    background: var(--sage-light);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--sage-dark);
    cursor: pointer;
}

/* AI Assistant Modal */
.ai-assistant .modal-content {
    max-width: 500px;
    height: 600px;
}

.ai-chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--gray-pale);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-message, .user-message {
    display: flex;
    gap: 12px;
    animation: messageIn 0.3s ease;
}

.ai-message {
    align-items: start;
}

.user-message {
    justify-content: flex-end;
}

.ai-avatar {
    width: 36px;
    height: 36px;
    background: var(--sage);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.ai-content, .user-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.5;
}

.ai-content {
    background: white;
    color: var(--charcoal);
}

.ai-content ul {
    margin: 8px 0 0 20px;
}

.ai-content li {
    margin-bottom: 4px;
}

.ai-content strong {
    color: var(--sage-dark);
}

.user-content {
    background: var(--sage);
    color: white;
}

.typing-indicator {
    display: flex;
    gap: 4px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--gray-medium);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

.ai-suggestions {
    display: flex;
    gap: 8px;
    padding: 12px;
    overflow-x: auto;
    background: var(--cream);
}

.ai-suggestions button {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--gray-light);
    border-radius: 20px;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.ai-suggestions button:hover {
    background: var(--sage-light);
    border-color: var(--sage);
}

.ai-input-container {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 16px;
    background: var(--warm-white);
    border-top: 1px solid var(--gray-pale);
}

.ai-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--gray-light);
    border-radius: 24px;
    font-size: 14px;
}

.ai-send-btn {
    padding: 10px 20px;
    background: var(--sage);
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.suggested-article {
    padding: 12px;
    background: var(--cream);
    border-radius: var(--radius-sm);
    margin: 8px 0;
    cursor: pointer;
    transition: all 0.2s;
}

.suggested-article:hover {
    background: var(--sage-light);
}