/* ============================================================
   ADDITIONAL COMPONENT STYLES
   style.css or create a new components.css
   ============================================================ */

/* ============================================================
   COMMENT SYSTEM STYLES
   ============================================================ */
.comment-box-inline {
    margin-top: 20px;
    padding: 20px;
    background: var(--header-footer-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    animation: slideDown 0.3s ease-out;
}

.comment-input-wrapper {
    margin-bottom: 20px;
}

.comment-input {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 14px;
    resize: vertical;
    background: var(--secondary-bg);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.comment-input:focus {
    outline: none;
    border-color: var(--competition-color);
}

.comment-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.submit-comment-btn,
.close-comment-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-sans);
}

.submit-comment-btn {
    background: linear-gradient(135deg, var(--competition-color), #2980b9);
    color: white;
}

.submit-comment-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.close-comment-btn {
    background: var(--secondary-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.close-comment-btn:hover {
    background: var(--border-color);
}

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

.comment-item {
    padding: 16px;
    margin-bottom: 12px;
    background: var(--secondary-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}

.comment-item:hover {
    transform: translateX(4px);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.comment-author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--competition-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.comment-time {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: 8px;
}

.comment-delete-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.comment-delete-btn:hover {
    background: rgba(244, 67, 54, 0.1);
    color: var(--accent-color);
}

.comment-body {
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.comment-footer {
    margin-top: 12px;
    display: flex;
    gap: 16px;
}

.comment-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.comment-like-btn:hover {
    background: rgba(52, 152, 219, 0.1);
    color: var(--competition-color);
}

.comment-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.comment-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent-color);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* ============================================================
   BOOKMARK STYLES (Enhanced)
   ============================================================ */
.saved-item {
    display: flex;
    gap: 15px;
    padding: 16px;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s;
}

.saved-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-medium);
}

.saved-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.saved-item-content {
    flex: 1;
    min-width: 0;
}

.saved-item-content h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.saved-item-content p {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.saved-item-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.saved-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.saved-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--header-footer-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
}

.saved-action-btn:hover {
    background: var(--competition-color);
    color: white;
    border-color: var(--competition-color);
}

/* ============================================================
   NEWS CARD STYLES
   ============================================================ */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    margin: 30px 0;
}

.story-card {
    background: var(--secondary-bg);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px var(--shadow-light);
    transition: all 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.story-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px var(--shadow-medium);
}

.story-card .story-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.3s;
}

.story-card:hover .story-image {
    transform: scale(1.05);
}

.story-card .story-headline {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    margin: 16px 20px 12px;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.story-card .story-text {
    font-size: 14px;
    line-height: 1.6;
    margin: 0 20px 16px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.story-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.story-source {
    font-size: 12px;
    font-weight: 600;
    color: var(--competition-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.bookmark-btn,
.share-btn,
.action-btn {
    background: var(--header-btn-bg);
    border: 1px solid var(--border-color);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0;
    box-shadow: 0 2px 4px var(--shadow-light);
    position: relative;
    overflow: hidden;
}

.action-btn.bookmark::before {
    content: '☆';
}

.action-btn.bookmark.saved::before {
    content: '★';
    color: #f1c40f;
}

.action-btn.x::before {
    content: 'X';
    font-weight: bold;
}

.action-btn.whatsapp::before {
    content: 'WA';
    font-size: 10px;
    font-weight: bold;
}

.action-btn.facebook::before {
    content: 'FB';
    font-weight: bold;
}

.bookmark-btn:hover,
.action-btn.bookmark:hover {
    color: #f1c40f;
    border-color: #f1c40f;
    background: rgba(241, 196, 15, 0.1);
    transform: scale(1.15);
}

.bookmark-btn.saved,
.action-btn.bookmark.saved {
    color: #f1c40f;
    border-color: #f1c40f;
    background: rgba(241, 196, 15, 0.05);
}

.share-btn:hover,
.action-btn:not(.bookmark):hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px var(--shadow-medium);
}

.share-btn.x:hover,
.action-btn.x:hover {
    background: #000 !important;
    color: #fff !important;
    border-color: #000 !important;
}

.share-btn.whatsapp:hover,
.action-btn.whatsapp:hover {
    background: #25D366 !important;
    color: #fff !important;
    border-color: #25D366 !important;
}

.share-btn.facebook:hover,
.action-btn.facebook:hover {
    background: #1877F2 !important;
    color: #fff !important;
    border-color: #1877F2 !important;
}

body.dark-mode .share-btn.x:hover {
    background: #fff !important;
    color: #000 !important;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    animation: slideInRight 0.3s ease-out;
    max-width: 400px;
    word-wrap: break-word;
}

.toast-success {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.toast-error {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
}

.toast-warning {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
}

.toast-info {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}

/* ============================================================
   MODAL IMPROVEMENTS
   ============================================================ */
.modal {
    backdrop-filter: blur(8px);
}

.modal.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal-content {
    animation: modalSlideIn 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================================
   LOADING STATES
   ============================================================ */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-secondary);
    font-style: italic;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 3px solid var(--border-color);
    border-top-color: var(--competition-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */
@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr;
    }

    .comment-box-inline {
        padding: 16px;
    }

    .comment-actions {
        flex-direction: column;
    }

    .saved-item {
        flex-direction: column;
    }

    .saved-item-image {
        width: 100%;
        height: 180px;
    }

    .toast {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* ============================================================
   DARK MODE ADJUSTMENTS
   ============================================================ */
body.dark-mode .comment-item {
    background: var(--primary-bg);
}

body.dark-mode .comment-box-inline {
    background: var(--primary-bg);
}

body.dark-mode .story-card {
    background: var(--primary-bg);
}

body.dark-mode .saved-item {
    background: var(--primary-bg);
}

/* ============================================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================================ */
.comment-input:focus,
.saved-action-btn:focus,
.submit-comment-btn:focus,
.close-comment-btn:focus {
    outline: 3px solid var(--competition-color);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {

    .story-card,
    .comment-item,
    .saved-item {
        transition: none;
    }

    .story-card:hover,
    .comment-item:hover,
    .saved-item:hover {
        transform: none;
    }
}