/* ========================================
   TouchLine Africa News - Red/Black Theme
   ======================================== */

/* Color Variables */
:root {
    --red-primary: #DC143C;
    --red-dark: #B22222;
    --red-light: #FF6B6B;
    --black-primary: #000000;
    --black-light: #1a1a1a;
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--gray-900);
    background-color: var(--gray-50);
    line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--black-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

a {
    text-decoration: none;
    color: var(--red-primary);
    transition: color 0.2s;
}

a:hover {
    color: var(--red-dark);
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ========================================
   NAVIGATION
   ======================================== */

.navbar-news {
    background-color: var(--black-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-news .nav-link {
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    font-weight: 500;
}

.navbar-news .nav-link:hover {
    background-color: var(--gray-800);
    color: var(--red-primary);
}

.navbar-news .nav-link.active {
    background-color: var(--red-primary);
    color: var(--white);
}

.navbar-news .nav-icon {
    color: var(--white);
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.navbar-news .nav-icon:hover {
    background-color: var(--gray-800);
    color: var(--red-primary);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--red-primary);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: bold;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    min-width: 1.25rem;
    text-align: center;
}

.navbar-news .mobile-nav-link {
    display: block;
    color: var(--white);
    padding: 0.75rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
    margin-top: 0.5rem;
}

.navbar-news .mobile-nav-link:hover {
    background-color: var(--gray-800);
}

/* Dropdown */
.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--gray-800);
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: var(--gray-100);
    color: var(--red-primary);
}

/* ========================================
   BUTTONS
   ======================================== */

.btn-primary {
    background-color: var(--red-primary);
    color: var(--white);
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.btn-primary:hover {
    background-color: var(--red-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(220, 20, 60, 0.3);
}

.btn-secondary {
    background-color: var(--gray-200);
    color: var(--gray-800);
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover {
    background-color: var(--gray-300);
}

.btn-outline {
    background-color: transparent;
    color: var(--red-primary);
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    border: 2px solid var(--red-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    background-color: var(--red-primary);
    color: var(--white);
}

.btn-action {
    background-color: transparent;
    color: var(--gray-600);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--gray-300);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-action:hover {
    background-color: var(--gray-100);
    border-color: var(--red-primary);
    color: var(--red-primary);
}

.btn-action.active {
    background-color: var(--red-primary);
    border-color: var(--red-primary);
    color: var(--white);
}

/* ========================================
   CARDS & CONTENT
   ======================================== */

.article-card {
    background: var(--white);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.article-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.article-card-content {
    padding: 1.5rem;
}

.article-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--black-primary);
    line-height: 1.3;
}

.article-card-excerpt {
    color: var(--gray-600);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--gray-500);
}

.article-stats {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--gray-600);
    font-size: 0.875rem;
}

/* ========================================
   COMMENTS
   ======================================== */

.comment {
    background: var(--white);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    border-left: 3px solid var(--gray-200);
    transition: border-color 0.2s;
}

.comment:hover {
    border-left-color: var(--red-primary);
}

.comment.level-0 { margin-left: 0; }
.comment.level-1 { margin-left: 2rem; }
.comment.level-2 { margin-left: 4rem; }
.comment.level-3 { margin-left: 6rem; }
.comment.level-4 { margin-left: 8rem; }

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.comment-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    object-fit: cover;
}

.comment-author {
    font-weight: 600;
    color: var(--black-primary);
}

.comment-time {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.comment-body {
    color: var(--gray-700);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.comment-action-btn {
    background: none;
    border: none;
    color: var(--gray-600);
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.comment-action-btn:hover {
    background-color: var(--gray-100);
    color: var(--red-primary);
}

/* Reactions */
.reactions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reaction-btn {
    font-size: 1.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.6;
}

.reaction-btn:hover {
    background-color: var(--gray-100);
    opacity: 1;
    transform: scale(1.2);
}

.reaction-btn.active {
    background-color: var(--red-primary);
    opacity: 1;
    transform: scale(1.1);
}

.reaction-count {
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 600;
}

/* ========================================
   MEDIA GALLERY
   ======================================== */

.media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.media-gallery img, .media-gallery video {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.media-gallery img:hover, .media-gallery video:hover {
    transform: scale(1.05);
}

/* ========================================
   ANALYTICS
   ======================================== */

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--red-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--gray-600);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat-change {
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.stat-change.positive {
    color: #10B981;
}

.stat-change.negative {
    color: #EF4444;
}

/* ========================================
   BLOGGER PROFILE
   ======================================== */

.profile-cover {
    height: 16rem;
    background-size: cover;
    background-position: center;
    position: relative;
}

.profile-avatar-wrapper {
    position: absolute;
    bottom: -4rem;
    left: 2rem;
}

.profile-avatar {
    width: 8rem;
    height: 8rem;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--white);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.profile-content {
    padding: 5rem 2rem 2rem;
}

.profile-name {
    font-size: 2rem;
    font-weight: 800;
    color: var(--black-primary);
    margin-bottom: 0.25rem;
}

.profile-username {
    color: var(--gray-600);
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.profile-bio {
    color: var(--gray-700);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.profile-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
}

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

.profile-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--black-primary);
    display: block;
}

.profile-stat-label {
    color: var(--gray-600);
    font-size: 0.875rem;
}

/* ========================================
   FORMS
   ======================================== */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--red-primary);
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.1);
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 8rem;
}

.form-help {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.form-error {
    font-size: 0.875rem;
    color: var(--red-primary);
    margin-top: 0.25rem;
}

/* ========================================
   ALERTS
   ======================================== */

.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background-color: #ECFDF5;
    border-left: 4px solid #10B981;
    color: #065F46;
}

.alert-error {
    background-color: #FEF2F2;
    border-left: 4px solid #EF4444;
    color: #991B1B;
}

.alert-warning {
    background-color: #FFFBEB;
    border-left: 4px solid #F59E0B;
    color: #92400E;
}

.alert-info {
    background-color: #EFF6FF;
    border-left: 4px solid #3B82F6;
    color: #1E40AF;
}

/* ========================================
   PAGINATION
   ======================================== */

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-link {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    color: var(--gray-700);
    background-color: var(--white);
    transition: all 0.2s;
}

.page-link:hover {
    background-color: var(--red-primary);
    border-color: var(--red-primary);
    color: var(--white);
}

.page-link.active {
    background-color: var(--red-primary);
    border-color: var(--red-primary);
    color: var(--white);
}

/* ========================================
   NOTIFICATIONS
   ======================================== */

#notification-panel {
    animation: slideDown 0.3s ease-out;
}

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

.notification-item {
    padding: 1rem;
    transition: background-color 0.2s;
    cursor: pointer;
}

.notification-item:hover {
    background-color: var(--gray-50);
}

.notification-item.unread {
    background-color: #FEF2F2;
    border-left: 3px solid var(--red-primary);
}

.notification-bell.has-unread {
    animation: ring 2s ease-in-out infinite;
}

@keyframes ring {
    0%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(-10deg); }
    20%, 40% { transform: rotate(10deg); }
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .container {
        padding: 0 0.75rem;
    }
    
    .comment {
        margin-left: 0 !important;
    }
    
    .media-gallery {
        grid-template-columns: 1fr;
    }
    
    .profile-avatar {
        width: 6rem;
        height: 6rem;
    }
    
    .profile-content {
        padding: 4rem 1rem 1rem;
    }
    
    .profile-stats {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    .btn-primary, .btn-secondary, .btn-outline {
        width: 100%;
        justify-content: center;
    }
    
    .article-stats {
        flex-wrap: wrap;
    }
    
    #notification-panel {
        right: 0;
        left: 0;
        width: 100%;
        border-radius: 0;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.text-red {
    color: var(--red-primary);
}

.bg-red {
    background-color: var(--red-primary);
}

.text-center {
    text-align: center;
}

.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }

.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-4 {
    gap: 1rem;
}

.rounded {
    border-radius: 0.5rem;
}

.shadow {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
