/* DividendCalculator.io - Hedgster Blue Theme */

:root {
    --primary: #0066FF;
    --primary-dark: #0052CC;
    --primary-light: #3385FF;
    --accent: #00C853;
    --accent-dark: #00A843;
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --bg: #F5F7FA;
    --bg-white: #FFFFFF;
    --text: #111827;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;
    --text-light: #9CA3AF;
    --border: #E5E7EB;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1.5rem;
    overflow-x: hidden;
}

/* Header */
.header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-accent { color: var(--accent); }

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover { color: var(--primary); }

/* Footer */
.footer {
    background: var(--text);
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: white;
}

.footer-col a {
    display: block;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.footer-col a:hover { color: white; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Page Layout */
.page {
    padding: 2rem 0;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.breadcrumb {
    display: flex;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }

/* Two Column Layout */
.layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.5rem;
    align-items: start;
    max-width: 100%;
    overflow: hidden;
}

.main-col { 
    display: flex; 
    flex-direction: column; 
    gap: 1.5rem; 
    min-width: 0; /* Prevent grid blowout */
    overflow: hidden;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Cards */
.card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Calculator Form */
.calc-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: var(--font);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-white);
}

.form-hint {
    font-size: 0.8125rem;
    color: var(--text-light);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-accent {
    background: var(--accent);
    color: white;
}

.btn-accent:hover {
    background: var(--accent-dark);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-full { width: 100%; }

/* Results */
.result-main {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.result-main .label {
    display: block;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 0.25rem;
}

.result-main .value {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.result-item {
    text-align: center;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.result-item .label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.result-item .value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
}

/* Market Data Grid */
.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.market-item {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    position: relative;
}

.market-item::after {
    content: '';
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
}

.market-item .label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.market-item .value {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.875rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-light);
}

.table tbody tr:hover {
    background: var(--bg);
}

.table .symbol {
    font-weight: 700;
    color: var(--primary);
}

.table .yield {
    font-weight: 600;
    color: var(--accent-dark);
}

/* Author & TOC Row */
.info-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Author Card - OmniCalculator Style */
.author-box {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.author-header {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.author-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFD700 0%, #0066FF 50%, #00C853 100%);
    padding: 3px;
    flex-shrink: 0;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.author-avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 1.25rem;
}

.author-details {
    flex: 1;
}

.author-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.author-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    display: block;
    margin-top: 0.125rem;
}

.author-section {
    margin-top: 0.75rem;
}

.author-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.75rem;
}

.author-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.author-meta-item i {
    width: 18px;
    color: var(--primary);
}

.author-meta-item strong {
    color: var(--text);
}

.author-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.author-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.author-action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.author-action-btn.liked {
    background: rgba(0, 102, 255, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.author-action-btn.voted {
    background: rgba(0, 102, 255, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.author-action-btn.voted i {
    font-weight: 900;
}

.author-action-btn.bookmarked {
    background: rgba(0, 102, 255, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.helpful-count {
    display: flex;
    align-items: center;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    padding: 0.5rem 0;
}

/* Year Table Styling */
.year-table-wrapper {
    overflow-x: auto;
    margin: -0.5rem;
    padding: 0.5rem;
}

.year-table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.year-table th,
.year-table td {
    padding: 0.625rem 0.5rem;
    text-align: right;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.year-table th {
    background: var(--bg);
    font-weight: 600;
    color: var(--text);
    position: sticky;
    top: 0;
}

.year-table th:first-child,
.year-table td:first-child {
    text-align: center;
    font-weight: 600;
}

.year-table tr:hover {
    background: var(--bg);
}

/* Legacy author card support */
.author-card {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-info .name {
    font-weight: 600;
    color: var(--text);
}

.author-info .role {
    font-size: 0.8125rem;
    color: var(--text-light);
}

.toc-list {
    list-style: none;
}

.toc-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.toc-list li:last-child { border-bottom: none; }

.toc-list a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
}

.toc-list a:hover { color: var(--primary); }

/* Source Dropdown */
.source-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.source-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Stock Profile */
.stock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.stock-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stock-badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.badge-sector {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.stock-symbol {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(0, 102, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
}

.stock-name {
    font-size: 1.5rem;
    font-weight: 600;
}

.stock-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.stat-box {
    text-align: center;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.stat-box .label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.stat-box .value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.stat-box .value.highlight {
    color: var(--accent-dark);
}

/* Links List */
.links-list {
    list-style: none;
}

.links-list li {
    margin-bottom: 0.5rem;
}

.links-list a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.links-list a:hover {
    background: var(--bg);
    color: var(--primary);
}

.links-list i {
    width: 16px;
    color: var(--text-light);
}

/* FAQ */
.faq-item {
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.faq-item summary {
    padding: 1rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item p {
    padding: 0 1rem 1rem;
    color: var(--text-secondary);
}

/* Sources List */
.sources-list {
    padding-left: 1.25rem;
}

.sources-list li {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.sources-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sources-list li a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.sources-list li a:hover {
    text-decoration: underline;
}

.sources-list li p {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 100px;
}

.badge-success { background: rgba(0, 200, 83, 0.1); color: var(--accent-dark); }
.badge-primary { background: rgba(0, 102, 255, 0.1); color: var(--primary); }

/* Error Pages */
.error-page {
    text-align: center;
    padding: 4rem 1rem;
}

.error-page .code {
    font-size: 8rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.error-page.error-500 .code {
    color: #EF4444;
}

.error-page h1 {
    font-size: 2rem;
    margin: 1rem 0;
}

.error-page p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.error-links {
    max-width: 400px;
    margin: 2rem auto 0;
    text-align: left;
}

.error-links h3 {
    text-align: center;
    margin-bottom: 1rem;
}

.error-links a {
    display: block;
    padding: 0.75rem 0;
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
    }
    
    .info-row {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .result-grid {
        grid-template-columns: 1fr;
    }
    
    .stock-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .market-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .nav {
        display: none;
    }
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Today's Dividends */
.todays-dividends .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.today-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.todays-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.today-stock {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.today-stock:hover {
    background: var(--primary);
    color: white;
}

.today-stock:hover .today-name,
.today-stock:hover .today-yield {
    color: rgba(255,255,255,0.9);
}

.today-symbol {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary);
}

.today-stock:hover .today-symbol {
    color: white;
}

.today-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.today-yield {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
    margin-top: 0.25rem;
}

@media (max-width: 768px) {
    .todays-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* New Author Box Style */
.author-box-new {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.author-avatar-ring {
    width: 72px;
    height: 72px;
    min-width: 72px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, #00C853, #00A843);
    flex-shrink: 0;
}

.author-avatar-ring img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
}

.author-info-new {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.author-label-new {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
}

.author-label-new:first-child {
    margin-top: 0;
}

.author-name-new {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.author-name-new:hover {
    text-decoration: underline;
}

.author-date {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

/* Fix old author box that uses author-avatar-ring */
.author-box .author-avatar-ring,
.author-header .author-avatar-ring {
    width: 56px;
    height: 56px;
    min-width: 56px;
}

.author-box .author-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

/* Tag Grid */
.tag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-link {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s;
}

.tag-link:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(0, 102, 255, 0.05);
}

/* Button Outline */
.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

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

/* Detailed Year Table */
.year-table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
}

.year-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.year-table th,
.year-table td {
    padding: 0.75rem 0.5rem;
    text-align: right;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.year-table th {
    background: var(--bg);
    font-weight: 600;
    color: var(--text);
    position: sticky;
    top: 0;
}

.year-table th:first-child,
.year-table td:first-child {
    text-align: center;
    font-weight: 600;
}

.year-table tr:hover {
    background: var(--bg);
}

/* Live Data Indicators */
.change {
    display: block;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.change.positive {
    color: var(--accent);
}

.change.negative {
    color: #EF4444;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--accent);
}

.live-indicator i {
    font-size: 0.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Stock page enhancements */
.stat-box {
    position: relative;
}

.stat-box .change {
    font-weight: 500;
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge i {
    font-size: 0.5rem;
}

