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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fafafa;
    background-image: radial-gradient(circle at 20% 20%, rgba(102, 126, 234, 0.03) 0%, transparent 50%),
                      radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.03) 0%, transparent 50%);
}

/* Markdown Content Styling */
/* These styles make markdown-rendered content look professional and readable */
.markdown-content {
    line-height: 1.7;
}

/* Headers in markdown */
.markdown-content h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 1.5rem 0 1rem 0;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.markdown-content h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 1.2rem 0 0.8rem 0;
    color: #34495e;
}

.markdown-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 1rem 0 0.6rem 0;
    color: #34495e;
}

.markdown-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0.8rem 0 0.5rem 0;
    color: #34495e;
}

/* Paragraphs in markdown */
.markdown-content p {
    margin: 0.8rem 0;
}

/* Bold text */
.markdown-content strong {
    font-weight: 600;
    color: #2c3e50;
}

/* Italic text */
.markdown-content em {
    font-style: italic;
    color: #555;
}

/* Bullet lists */
.markdown-content ul {
    margin: 0.8rem 0;
    padding-left: 2rem;
    list-style-type: disc;
}

.markdown-content ul li {
    margin: 0.4rem 0;
    padding-left: 0.3rem;
}

/* Nested lists */
.markdown-content ul ul {
    margin: 0.3rem 0;
    padding-left: 1.5rem;
    list-style-type: circle;
}

/* Numbered lists */
.markdown-content ol {
    margin: 0.8rem 0;
    padding-left: 2rem;
    list-style-type: decimal;
}

.markdown-content ol li {
    margin: 0.4rem 0;
    padding-left: 0.3rem;
}

/* Code blocks and inline code */
.markdown-content code {
    background-color: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    color: #c7254e;
}

.markdown-content pre {
    background-color: #f4f4f4;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
}

.markdown-content pre code {
    background-color: transparent;
    padding: 0;
    color: #333;
}

/* Links */
.markdown-content a {
    color: #3498db;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-bottom-color 0.2s;
}

.markdown-content a:hover {
    border-bottom-color: #3498db;
}

/* Blockquotes */
.markdown-content blockquote {
    border-left: 4px solid #3498db;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #666;
    font-style: italic;
}

/* Horizontal rules */
.markdown-content hr {
    border: none;
    border-top: 2px solid #e0e0e0;
    margin: 1.5rem 0;
}

/* Tables (if AI uses them) */
.markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
}

.markdown-content table th,
.markdown-content table td {
    border: 1px solid #ddd;
    padding: 0.6rem;
    text-align: left;
}

.markdown-content table th {
    background-color: #f4f4f4;
    font-weight: 600;
}

.markdown-content table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Responsive layout */
@media (max-width: 968px) {
    .ticker-page-layout {
        flex-direction: column;
    }
    
    .ticker-right-column {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
    
    .ticker-metrics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .ticker-metric-section {
        padding: 1rem;
    }
    
    .ticker-data-value.large {
        font-size: 1.5rem;
    }
}

/* ============================================
   RESPONSIVE NAVIGATION - Modern & Clean
   ============================================ */

/* Header container */
.header {
    background-color: #0a0a0a;
    background-image: linear-gradient(to right, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    color: #ffffff;
    padding: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
    position: relative;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #ffffff;
    transition: opacity 0.2s;
    user-select: none;
    cursor: pointer;
    z-index: 101;
    text-decoration: none;
}

.logo:hover {
    opacity: 0.8;
}

/* Logo image */
.logo-image {
    height: 36px;
    width: auto;
    display: block;
}

/* Logo text - white color */
.logo-text {
    color: #ffffff;
}

/* Hide logo text on mobile, keep only icon */
@media (max-width: 768px) {
    .logo-text {
        display: none;
    }
    
    .logo-image {
        height: 32px;
    }
}

/* Hamburger Menu Button - Mobile Only */
.hamburger-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 101;
}

.hamburger-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Hamburger animation when active */
.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Navigation container */
.nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Navigation links */
.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.nav-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    color: #ffffff;
    background-color: rgba(102, 126, 234, 0.2);
}

.nav-link:active {
    transform: scale(0.98);
}

/* User Profile Dropdown */
.user-profile {
    position: relative;
    margin-left: 1rem;
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 0.4rem 0.8rem 0.4rem 0.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-profile-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* User avatar circle */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #187bc5 0%, #21d1bc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
    text-transform: uppercase;
}

/* User name and info */
.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
}

.user-badge {
    font-size: 0.7rem;
    color: rgba(102, 126, 234, 0.9);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Dropdown menu */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    min-width: 180px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    overflow: hidden;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a,
.user-dropdown button {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 1);
}

.user-dropdown .dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.25rem 0;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Show hamburger button on mobile */
    .hamburger-btn {
        display: flex;
    }
    
    /* Hide navigation by default on mobile */
    .nav {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: #0a0a0a;
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
        transform: translateX(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    /* Show navigation when active */
    .nav.active {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
    }
    
    /* Stack navigation links vertically */
    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 0;
        align-items: stretch;
    }
    
    /* Fix for span wrappers around Settings and Admin links */
    #settings-link-wrapper,
    #admin-link-wrapper {
        display: block;
        width: 100%;
    }
    
    .nav-link {
        display: block;
        width: 100%;
        padding: 1.25rem 1.5rem;
        border-radius: 0;
        text-align: left;
        margin: 0;
    }
    
    .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.08);
    }
    
    /* Add separator between links for better visual spacing */
    .nav-link + .nav-link,
    #settings-link-wrapper + #admin-link-wrapper,
    .nav-links > span + span {
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    /* User profile section on mobile */
    .user-profile {
        width: 100%;
        margin-left: 0;
        margin-top: 0.5rem;
        padding: 1rem 1.5rem 0 1.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }
    
    .user-profile-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 0.75rem 1rem;
        border-radius: 8px;
    }
    
    /* Dropdown on mobile appears below */
    .user-dropdown {
        position: static;
        transform: none;
        margin-top: 0.5rem;
        border-radius: 8px;
    }
    
    .user-dropdown.active {
        transform: none;
    }
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 64px);
    padding: 2.5rem 0;
}

.page {
    display: block;
}

.page.hidden {
    display: none;
}

/* Buttons - Modern Style */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, #187bc5 0%, #21d1bc 100%);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
    background-color: #e8e8e8;
    border-color: #d0d0d0;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Page Header - For title and action button */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h2 {
    margin: 0;
}

/* Ticker List Grid */
.ticker-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

/* Mobile responsive for page header */
@media (max-width: 600px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .page-header button {
        width: 100%;
    }
}

.ticker-card {
    background: white;
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

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

/* Company name in ticker cards (home page) */
.ticker-card .company-name {
    font-size: 0.9rem;
    font-weight: 400;
    color: #6c757d;
    font-style: normal;
    margin: 0.25rem 0 0.5rem 0;
}

/* Ticker Page */
.ticker-header {
    background: white;
    padding: 1.5rem;
    border-radius: 4px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Two-column layout for ticker page */
.ticker-page-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.ticker-left-column {
    flex: 2;
    min-width: 0; /* Allows flex item to shrink below content size */
}

.ticker-right-column {
    flex: 1;
    min-width: 0;
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 6rem);
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: visible;
}

.ticker-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.company-name {
    font-size: 1.25rem;
    font-weight: 400;
    color: #6c757d;
    font-style: italic;
}

.ticker-current-summary {
    width: 100%;
}

/* Metrics Grid Layout */
.ticker-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

/* Metric Section */
.ticker-metric-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.25rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.ticker-metric-section:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #dee2e6;
}

.ticker-metric-section.price-section {
    background: linear-gradient(135deg, #187bc5 0%, #21d1bc 100%);
    color: white;
    border: none;
}

.ticker-metric-section.price-section .ticker-data-label {
    color: rgba(255, 255, 255, 0.9);
}

.ticker-metric-section.price-section .ticker-data-value {
    color: white;
}

.metric-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #495057;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.ticker-metric-section.price-section .metric-section-title {
    color: rgba(255, 255, 255, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.metric-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ticker-data-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ticker-data-label {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ticker-data-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
    line-height: 1.3;
}

.ticker-data-value.large {
    font-size: 1.75rem;
    font-weight: 700;
}

.ticker-data-value.positive {
    color: #27ae60;
}

.ticker-data-value.negative {
    color: #e74c3c;
}

.ticker-data-value.highlight {
    color: #f39c12;
    font-weight: 700;
}

.ticker-metric-section.price-section .ticker-data-value.positive,
.ticker-metric-section.price-section .ticker-data-value.negative {
    color: white;
    opacity: 0.95;
}

.ticker-data-warning {
    padding: 1rem;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
}

.ticker-data-warning p {
    margin: 0.5rem 0;
}

.ticker-data-warning p:first-child {
    margin-top: 0;
}

.ticker-data-warning p:last-child {
    margin-bottom: 0;
}

/* Thesis Section */
.thesis-section {
    background: white;
    padding: 1.5rem;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: fit-content;
}

.thesis-content {
    margin: 1rem 0;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 4px;
    min-height: 100px;
}

.thesis-content .placeholder {
    color: #999;
    font-style: italic;
}

/* Thesis button wrapper - displays button and pending count side by side */
.thesis-button-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Pending content count message - subtle styling */
.pending-content-message {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
    opacity: 0.8;
}

/* API Payload Log (Admin Only) */
.thesis-api-log {
    margin-top: 1.5rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0;
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

.api-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #e9ecef;
    border-bottom: 1px solid #dee2e6;
    border-radius: 4px 4px 0 0;
}

.api-log-header h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
}

.btn-clear-log {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.btn-clear-log:hover {
    background-color: #dee2e6;
    color: #495057;
}

.api-log-content {
    flex: 1;
    padding: 1rem;
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #212529;
    background: white;
    overflow: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    border-radius: 0 0 4px 4px;
}

/* Submission Section */
.submission-section {
    background: white;
    padding: 1.5rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.submission-section h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

/* Link Input - Minimal inline style */
.link-input-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.link-input {
    flex: 1;
    padding: 0.75rem;
    border: none;
    font-size: 1rem;
    outline: none;
}

.link-input:focus {
    outline: none;
}

.link-submit-btn {
    padding: 0.75rem 1rem;
    background-color: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background-color 0.2s;
}

.link-submit-btn:hover {
    background-color: #2980b9;
}

/* Recording - Minimal icon style */
.recording-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.recording-label {
    color: #e74c3c;
    font-size: 0.9rem;
    font-weight: 500;
    user-select: none;
}

.record-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: transform 0.2s, background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.record-icon-btn:hover {
    background-color: #f0f0f0;
    transform: scale(1.1);
}

.record-icon-btn.recording {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Document Upload - Minimal icon style */
.document-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.document-label {
    color: #2ecc71;
    font-size: 0.9rem;
    font-weight: 500;
    user-select: none;
}

.document-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: transform 0.2s, background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.document-icon-btn:hover {
    background-color: #f0f0f0;
    transform: scale(1.1);
}

/* Audio Visualization */
.audio-visualization {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 32px;
}

.audio-bar {
    width: 4px;
    background-color: #e74c3c;
    border-radius: 2px;
    transition: height 0.05s ease-out;
    min-height: 2px;
}

/* Audio bars are animated via JavaScript, not CSS */

.submission-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-input {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.recording-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.recording-status {
    color: #e74c3c;
    font-weight: bold;
}

/* Items Section */
.items-section {
    background: white;
    padding: 1.5rem;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.item-card {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    background-color: #f9f9f9;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.item-card:hover {
    background-color: #f0f0f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: #ccc;
}

.item-thumbnail {
    margin-bottom: 1rem;
    border-radius: 4px;
    overflow: hidden;
    max-width: 100%;
    position: relative;
    min-height: 200px;
    background-color: #f0f0f0;
}

.item-thumbnail img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
    display: none;
}

.item-thumbnail img.thumbnail-image {
    display: block;
}

.thumbnail-skeleton {
    width: 100%;
    height: 200px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

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

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
}

.item-datetime {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.75rem;
}

.btn-delete-item {
    width: 24px;
    height: 24px;
    padding: 0;
    background-color: #555;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    position: relative;
    z-index: 2;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.1s;
}

.btn-delete-item:hover {
    background-color: #333;
    transform: scale(1.1);
}

.btn-delete-item:active {
    background-color: #222;
    transform: scale(0.95);
}

.item-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: bold;
    text-transform: uppercase;
}

.item-type.youtube {
    background-color: #ff0000;
    color: white;
}

.item-type.article {
    background-color: #3498db;
    color: white;
}

.item-type.recording {
    background-color: #9b59b6;
    color: white;
}

.item-type.reddit {
    background-color: #FF4500;
    color: white;
}

.item-type.document {
    background-color: #2ecc71;
    color: white;
}

.item-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.item-content {
    margin-bottom: 0.5rem;
    word-break: break-all;
}

.item-content a {
    color: #3498db;
    text-decoration: none;
}

.item-content a:hover {
    text-decoration: underline;
}

.item-snapshot {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #ddd;
}

.item-analysis {
    margin-top: 1rem;
    padding: 1rem;
    background-color: white;
    border-radius: 4px;
    border-left: 3px solid #3498db;
}

.item-analysis-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

/* Settings Page */
.settings-section {
    background: white;
    padding: 1.5rem;
    border-radius: 4px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Thesis Prompts Section - Special styling to make it stand out */
.thesis-prompts-section {
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border: 2px solid #667eea;
    border-left: 5px solid #667eea;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.15);
}

.thesis-prompts-section h2,
.thesis-prompts-section h3 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.thesis-prompts-section .help-text {
    color: #555;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.prompt-help-text {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
    margin: -0.3rem 0 0.5rem 0;
}

.api-key-group {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e9ecef;
}

.api-key-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.api-key-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.help-text {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #666;
}

.prompt-editor {
    margin-bottom: 2rem;
}

.prompt-editor label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.prompt-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: monospace;
    resize: vertical;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    color: white;
    margin-top: 1rem;
    font-size: 1.1rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* Small modal for simple forms */
.modal-content.modal-small {
    max-width: 450px;
    padding: 1.75rem;
}

/* Wide modal for detailed content display */
.modal-content.modal-wide {
    max-width: 800px;
}

.modal-content h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.modal-message {
    margin-bottom: 1rem;
    color: #666;
    line-height: 1.6;
}

.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 1rem;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Prompt Log Section - Display API call details */
.prompt-log-section {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.prompt-log-section.hidden {
    display: none;
}

.prompt-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.prompt-log-header h4 {
    margin: 0;
    font-size: 0.95rem;
    color: #495057;
    font-weight: 600;
}

.btn-toggle-log {
    background: none;
    border: 1px solid #ced4da;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #495057;
    transition: all 0.2s;
}

.btn-toggle-log:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.prompt-log-content {
    margin-top: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.prompt-log-content.hidden {
    display: none;
}

.prompt-log-label {
    font-weight: 600;
    color: #495057;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.prompt-log-label:first-child {
    margin-top: 0;
}

.prompt-log-text {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.75rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #212529;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
}

/* SWOT Analysis Quadrant Chart */
.swot-chart-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #dee2e6;
}

.swot-chart-section.hidden {
    display: none;
}

.swot-chart-section h4 {
    margin: 0 0 1.5rem 0;
    font-size: 1.25rem;
    color: #2c3e50;
    text-align: center;
}

.swot-quadrant-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.swot-quadrant {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: 200px;
}

.swot-quadrant-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid;
}

.swot-icon {
    font-size: 1.5rem;
}

.swot-quadrant-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.swot-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.swot-list li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.5;
    font-size: 0.95rem;
}

.swot-list li:before {
    content: '•';
    position: absolute;
    left: 0.5rem;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Strengths Quadrant - Green theme */
.strengths-quadrant {
    border-top: 4px solid #2ecc71;
}

.strengths-quadrant .swot-quadrant-header {
    border-bottom-color: #2ecc71;
}

.strengths-quadrant .swot-quadrant-header h5 {
    color: #27ae60;
}

.strengths-quadrant .swot-list li:before {
    color: #2ecc71;
}

/* Weaknesses Quadrant - Orange theme */
.weaknesses-quadrant {
    border-top: 4px solid #e67e22;
}

.weaknesses-quadrant .swot-quadrant-header {
    border-bottom-color: #e67e22;
}

.weaknesses-quadrant .swot-quadrant-header h5 {
    color: #d35400;
}

.weaknesses-quadrant .swot-list li:before {
    color: #e67e22;
}

/* Opportunities Quadrant - Blue theme */
.opportunities-quadrant {
    border-top: 4px solid #3498db;
}

.opportunities-quadrant .swot-quadrant-header {
    border-bottom-color: #3498db;
}

.opportunities-quadrant .swot-quadrant-header h5 {
    color: #2980b9;
}

.opportunities-quadrant .swot-list li:before {
    color: #3498db;
}

/* Threats Quadrant - Red theme */
.threats-quadrant {
    border-top: 4px solid #e74c3c;
}

.threats-quadrant .swot-quadrant-header {
    border-bottom-color: #e74c3c;
}

.threats-quadrant .swot-quadrant-header h5 {
    color: #c0392b;
}

.threats-quadrant .swot-list li:before {
    color: #e74c3c;
}

/* Responsive SWOT chart */
@media (max-width: 768px) {
    .swot-quadrant-grid {
        grid-template-columns: 1fr;
    }
}

/* Item Details Modal Styles */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
}

.btn-close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: #adb5bd;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.btn-close-modal:hover {
    color: #495057;
}

.item-details-body {
    margin-bottom: 1.5rem;
}

.item-detail-section {
    margin-bottom: 1.5rem;
}

.item-detail-section h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.item-detail-section p {
    margin: 0;
    color: #212529;
}

.item-details-content-box,
.item-details-analysis-box {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
}

.item-details-content-box a {
    color: #3498db;
    word-break: break-all;
}

.item-details-analysis-box {
    font-size: 0.95rem;
}

/* Item content styling */
.item-content {
    margin-top: 0.5rem;
}

/* Links inside item cards should still work when clicked */
.item-card a {
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

.item-content-text {
    display: inline;
}

/* Visual indicator that cards are clickable */
.item-card::after {
    content: '🔍 Click for details';
    position: absolute;
    top: 0.5rem;
    right: 3rem;
    font-size: 0.75rem;
    color: #999;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.item-card:hover::after {
    opacity: 0.6;
}

/* News Analysis Styles */
.news-analysis-container {
    padding: 1rem;
}

.news-summary-section {
    background: linear-gradient(135deg, #187bc5 0%, #21d1bc 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.news-summary-section h3 {
    margin: 0 0 1rem 0;
    color: white;
    font-size: 1.3rem;
}

.news-summary-content {
    line-height: 1.7;
    font-size: 1rem;
}

.news-daily-breakdown {
    margin-top: 1.5rem;
}

.news-daily-breakdown > h3 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-size: 1.3rem;
}

.news-date-section {
    margin-bottom: 2rem;
    border-left: 4px solid #3498db;
    padding-left: 1.5rem;
}

.news-date-header {
    color: #2c3e50;
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.news-article-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.news-article-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.news-article-title {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.news-article-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s;
}

.news-article-title a:hover {
    color: #3498db;
}

.news-article-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #7f8c8d;
}

.news-publisher {
    font-weight: 500;
}

.news-time {
    color: #95a5a6;
}

.news-article-analysis {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #34495e;
}

.news-article-analysis strong {
    color: #2c3e50;
    font-weight: 600;
}

/* Responsive adjustments for news analysis */
@media (max-width: 768px) {
    .news-analysis-container {
        padding: 0.75rem;
    }
    
    .news-summary-section {
        padding: 1rem;
    }
    
    .news-date-section {
        padding-left: 1rem;
        border-left-width: 3px;
    }
    
    .news-article-card {
        padding: 1rem;
    }
    
    .news-article-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* ============================================
   AUTH PAGE STYLES (Login/Signup)
   ============================================ */

/* Auth page body - centers the entire auth card */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #fafafa;
    background-image: radial-gradient(circle at 20% 20%, rgba(102, 126, 234, 0.05) 0%, transparent 50%),
                      radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.05) 0%, transparent 50%);
}

/* Main container for auth card */
.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
}

/* The white card that holds the login/signup form */
.auth-card {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
}

/* The logo/title at the top */
.auth-logo-container {
    text-align: center;
    margin-bottom: 1rem;
}

.auth-logo-image {
    height: 80px;
    width: auto;
    display: inline-block;
}

/* Tagline under the logo */
.auth-tagline {
    color: #6c757d;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* Form wrapper */
.auth-form {
    text-align: left;
}

/* Form heading (Login/Sign Up) */
.auth-form h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    text-align: center;
}

/* Form group - wraps label and input */
.form-group {
    margin-bottom: 1.25rem;
}

/* Form labels */
.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* Small help text under inputs */
.help-text {
    display: block;
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Full-width button for login/signup */
.btn-full-width {
    width: 100%;
    margin-top: 0.5rem;
}

/* Text at bottom prompting to switch forms */
.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #6c757d;
}

/* Link to switch between login/signup */
.auth-switch a {
    color: #187bc5;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-switch a:hover {
    color: #21d1bc;
    text-decoration: underline;
}

/* Footer text below the card */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: #6c757d;
    font-size: 0.85rem;
}

/* Hidden class for form switching */
.hidden {
    display: none;
}

/* Responsive adjustments for auth page */
@media (max-width: 480px) {
    .auth-container {
        padding: 1rem;
    }
    
    .auth-card {
        padding: 1.75rem;
    }
    
    .auth-logo {
        font-size: 1.5rem;
    }
}

/* ============================================
   ADMIN PAGE STYLES
   ============================================ */

/* Users table container */
.users-table-container {
    overflow-x: auto;
    margin-top: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Users table */
.users-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.users-table thead {
    background: linear-gradient(135deg, #187bc5 0%, #21d1bc 100%);
    color: white;
}

.users-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.users-table td {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.95rem;
}

.users-table tbody tr:hover {
    background-color: #f8f9fa;
}

.users-table tbody tr:last-child td {
    border-bottom: none;
}

/* Actions cell */
.actions-cell {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Small button variant */
.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Role badges */
.role-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-admin {
    background: linear-gradient(135deg, #187bc5 0%, #21d1bc 100%);
    color: white;
}

.role-user {
    background-color: #e9ecef;
    color: #495057;
}

/* Responsive table */
@media (max-width: 768px) {
    .users-table {
        font-size: 0.85rem;
    }
    
    .users-table th,
    .users-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .btn-small {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
}

