/* ============================================
   SIGNALS PAGE STYLES
   ============================================ */

/* Page Header */
.page-header {
    text-align: center;
    padding: 20px 20px 30px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.page-header h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================
   SIGNALS GRID - Card Layout
   ============================================ */
.signals-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 80px);
}

.signals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

/* Individual Signal Card */
.signal-card {
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.9), rgba(30, 30, 30, 0.9));
    border: 1px solid rgba(92, 197, 167, 0.2);
    border-radius: 16px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
}

.signal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-hover));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.signal-card:hover::before {
    transform: scaleX(1);
}

.signal-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-green);
    box-shadow: 0 10px 30px rgba(92, 197, 167, 0.3);
}

/* Signal Card Header */
.signal-card-header {
    margin-bottom: 20px;
}

.signal-card-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.3;
}

.signal-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.signal-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-category {
    background: rgba(92, 197, 167, 0.2);
    color: var(--accent-green);
    border: 1px solid var(--accent-green);
}

.badge-horizon {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge-date {
    background: rgba(100, 100, 100, 0.2);
    color: var(--text-secondary);
    border: 1px solid rgba(150, 150, 150, 0.3);
}

/* Signal Card Summary */
.signal-card-summary {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Read More Link */
.read-more {
    color: var(--accent-green);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.3s ease;
}

.read-more:hover {
    gap: 10px;
}

/* ============================================
   LOADING SKELETON
   ============================================ */
.loading-skeleton {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.skeleton-card {
    background: linear-gradient(90deg, rgba(30, 30, 30, 0.9) 25%, rgba(40, 40, 40, 0.9) 50%, rgba(30, 30, 30, 0.9) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 16px;
    height: 300px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   MODAL STYLES
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, #1a1a1a, #0d0d0d);
    margin: 3% auto;
    border: 1px solid rgba(92, 197, 167, 0.3);
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    position: relative;
    animation: slideDown 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Signal modal specific - override for flex layout */
.signal-modal-content {
    padding: 0;
}

.signal-modal-content .close-modal {
    position: absolute;
    top: 16px;
    right: 20px;
    z-index: 10;
    float: none;
}

/* Scrollable body inside signal modal */
.signal-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 40px 40px 20px 40px;
}

.signal-modal-body::-webkit-scrollbar {
    width: 8px;
}

.signal-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.signal-modal-body::-webkit-scrollbar-thumb {
    background: var(--accent-green);
    border-radius: 10px;
}

.signal-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* Sticky CTA footer */
.signal-cta-sticky {
    padding: 16px 40px;
    border-top: 1px solid rgba(92, 197, 167, 0.2);
    background: linear-gradient(135deg, #1a1a1a, #0d0d0d);
    text-align: center;
    flex-shrink: 0;
}

.signal-cta-sticky .cta-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.linkedin-icon {
    flex-shrink: 0;
}

/* Post modal keeps standard padding */
.post-modal-content {
    padding: 40px;
    overflow-y: auto;
}

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

/* Custom scrollbar for modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--accent-green);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* Close Button */
.close-modal {
    color: var(--text-secondary);
    float: right;
    font-size: 32px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--accent-green);
    transform: rotate(90deg);
}

/* ============================================
   SIGNAL DETAIL (IN MODAL)
   ============================================ */
.signal-header {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid rgba(92, 197, 167, 0.2);
}

.signal-header h1 {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    line-height: 1.3;
}

.signal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.signal-section {
    margin-bottom: 35px;
}

.signal-section h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--accent-green);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.signal-content {
    color: var(--text-secondary);
    font-size: 17px;
    line-height: 1.8;
    white-space: pre-line;
}

.signal-content p {
    margin-bottom: 15px;
}

/* Narrative Seed (Blockquote) */
.narrative-seed {
    background: linear-gradient(135deg, rgba(92, 197, 167, 0.1), rgba(92, 197, 167, 0.05));
    border-left: 4px solid var(--accent-green);
    padding: 25px;
    border-radius: 8px;
    margin: 30px 0;
}

.narrative-seed blockquote {
    font-size: 20px;
    font-weight: 500;
    font-style: italic;
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
}


/* ============================================
   POST GENERATION MODAL
   ============================================ */
.post-modal-content {
    max-width: 700px;
}

.post-modal-content h2 {
    color: var(--accent-green);
    margin-bottom: 10px;
}

.modal-subtitle {
    color: var(--text-secondary);
    margin-bottom: 25px;
    font-size: 16px;
}

.generated-post-area {
    background: rgba(20, 20, 20, 0.6);
    border: 2px solid rgba(92, 197, 167, 0.3);
    border-radius: 12px;
    padding: 25px;
    min-height: 250px;
    max-height: 400px;
    overflow-y: auto;
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 25px;
    white-space: pre-wrap;
    cursor: text;
}

.generated-post-area:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(92, 197, 167, 0.1);
}

/* Post Actions */
.post-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Success Message */
.success-message {
    background: rgba(92, 197, 167, 0.2);
    color: var(--accent-green);
    padding: 12px 20px;
    border-radius: 8px;
    text-align: center;
    margin-top: 20px;
    font-weight: 600;
    border: 1px solid var(--accent-green);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .signals-grid,
    .loading-skeleton {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 36px;
    }
    
    .signals-grid,
    .loading-skeleton {
        grid-template-columns: 1fr;
    }
    
    .signal-card {
        padding: 20px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .signal-modal-body {
        padding: 25px 25px 15px 25px;
    }

    .signal-cta-sticky {
        padding: 12px 25px;
    }
    
    .signal-header h1 {
        font-size: 28px;
    }
    
    .signal-section h2 {
        font-size: 20px;
    }
    
    .post-actions {
        flex-direction: column;
    }
    
    .post-actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 40px 15px 30px 15px;
    }
    
    .page-header h1 {
        font-size: 28px;
    }
    
    .subtitle {
        font-size: 16px;
    }
    
    .signal-card-title {
        font-size: 20px;
    }
}

/* ============================================
   ADMIN FLOATING ACTION BUTTON
   ============================================ */
.admin-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, var(--accent-green, #5CC5A7), var(--accent-hover, #4AB393));
    color: #0D0D0D;
    padding: 16px 28px;
    border-radius: 50px;
    box-shadow: 0 8px 24px rgba(92, 197, 167, 0.4);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s ease;
    z-index: 1000;
    cursor: pointer;
}

.admin-fab:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 32px rgba(92, 197, 167, 0.6);
}

.admin-fab .fab-icon {
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
}

.admin-fab .fab-text {
    font-size: 15px;
    letter-spacing: 0.3px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .admin-fab {
        bottom: 20px;
        right: 20px;
        padding: 14px 20px;
    }

    .admin-fab .fab-text {
        display: none;
    }

    .admin-fab .fab-icon {
        font-size: 28px;
    }
}

/* ============================================
   Info Message for Existing Posts
   ============================================ */
.info-message {
    background: rgba(92, 197, 167, 0.1);
    border-left: 4px solid var(--primary-color);
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

/* ============================================
   Visual Generation Section
   ============================================ */
.visual-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(92, 197, 167, 0.2);
}

.visual-header h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.visual-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.visual-loading {
    text-align: center;
    padding: 30px;
}

.loading-spinner-small {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(92, 197, 167, 0.2);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px auto;
}

.visual-result {
    text-align: center;
    margin-top: 20px;
}

.visual-result img {
    width: 100%;
    max-width: 600px;
    border-radius: 12px;
    border: 1px solid rgba(92, 197, 167, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    margin-bottom: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.visual-info {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 10px;
}

.error-message {
    background: rgba(255, 107, 107, 0.1);
    border-left: 4px solid #ff6b6b;
    padding: 12px 16px;
    margin-top: 15px;
    border-radius: 4px;
    color: #ff6b6b;
    font-size: 14px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   TRENDING & EARLY SIGNALS SECTIONS
   ============================================ */

/* Section Container */
.signal-section-container {
    margin-bottom: 50px;
}

.signal-section-container .section-header {
    margin-bottom: 25px;
}

.signal-section-container .section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.signal-section-container .section-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
}


/* Horizontal Scroll Container */
.horizontal-scroll {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 5px 20px 5px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.horizontal-scroll::-webkit-scrollbar {
    height: 6px;
}

.horizontal-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.horizontal-scroll::-webkit-scrollbar-thumb {
    background: rgba(92, 197, 167, 0.5);
    border-radius: 3px;
}

.horizontal-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(92, 197, 167, 0.8);
}

/* Featured Signal Cards (Trending/Early) */
.featured-card {
    min-width: 320px;
    max-width: 360px;
    flex-shrink: 0;
    scroll-snap-align: start;
    background: rgba(20, 20, 20, 0.9);
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.featured-card:hover {
    transform: translateY(-6px);
}

/* Trending Card Accent */
.trending-card {
    border: 1px solid rgba(255, 107, 107, 0.3);
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.08), rgba(20, 20, 20, 0.95));
}

.trending-card:hover {
    border-color: rgba(255, 107, 107, 0.6);
    box-shadow: 0 12px 30px rgba(255, 107, 107, 0.2);
}

/* Early Card Accent */
.early-card {
    border: 1px solid rgba(92, 197, 167, 0.3);
    background: linear-gradient(135deg, rgba(92, 197, 167, 0.08), rgba(20, 20, 20, 0.95));
}

.early-card:hover {
    border-color: rgba(92, 197, 167, 0.6);
    box-shadow: 0 12px 30px rgba(92, 197, 167, 0.2);
}

/* Card Badge */
.card-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.trending-badge {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.4);
}

.early-badge {
    background: rgba(92, 197, 167, 0.2);
    color: #5cc5a7;
    border: 1px solid rgba(92, 197, 167, 0.4);
}

/* Card Headline */
.card-headline {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Meta */
.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-size: 12px;
}

/* Trending Indicator with Pulse */
.trending-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ff6b6b;
    font-weight: 500;
}

.pulse {
    width: 8px;
    height: 8px;
    background: #ff6b6b;
    border-radius: 50%;
    animation: pulse-animation 1.5s infinite;
}

@keyframes pulse-animation {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.3);
    }
}

/* Timing Advantage */
.timing-advantage {
    color: #5cc5a7;
    font-weight: 500;
}

/* Score Badge */
.score-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-secondary);
}

/* Why Section / What Happened Section */
.why-section,
.what-happened {
    margin-bottom: 14px;
}

.why-section strong,
.what-happened strong {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.why-section p,
.what-happened p {
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.75);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Coverage Indicator */
.coverage-indicator {
    margin-bottom: 14px;
}

.coverage-level {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
}

.coverage-level.low {
    background: rgba(92, 197, 167, 0.2);
    color: #5cc5a7;
}

.coverage-level.medium {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.coverage-level.high {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

/* Tone Options */
.tone-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tone-chip {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tone-chip:hover {
    background: rgba(92, 197, 167, 0.15);
    border-color: rgba(92, 197, 167, 0.5);
    color: #5cc5a7;
}

.tone-chip.selected {
    background: rgba(92, 197, 167, 0.25);
    border-color: #5cc5a7;
    color: #5cc5a7;
}

/* Generate Button in Cards */
.featured-card .generate-btn {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #5cc5a7, #4db897);
    border: none;
    border-radius: 8px;
    color: #0d0d0d;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: auto;
}

.featured-card .generate-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(92, 197, 167, 0.35);
}

.trending-card .generate-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
}

.trending-card .generate-btn:hover {
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.35);
}

/* No Signals Message */
.no-signals-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 16px;
}

/* ============================================
   RESPONSIVE - Trending/Early Sections
   ============================================ */
@media (max-width: 768px) {
    .signal-section-container .section-title {
        font-size: 22px;
    }

    .featured-card {
        min-width: 280px;
        max-width: 300px;
        padding: 20px;
    }

    .card-headline {
        font-size: 16px;
    }

    .horizontal-scroll {
        padding: 5px 0 15px 0;
    }
}

@media (max-width: 480px) {
    .featured-card {
        min-width: 260px;
        max-width: 280px;
    }

    .signal-section-container .section-title {
        font-size: 20px;
    }

    .signal-section-container .section-subtitle {
        font-size: 14px;
    }
}