/* Material Design 3 - Complete Stylesheet */

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

:root {
    /* MD3 Color Tokens */
    --md-sys-color-primary: #0B57D0;
    --md-sys-color-on-primary: #FFFFFF;
    --md-sys-color-primary-container: #D3E3FD;
    --md-sys-color-on-primary-container: #001C38;
    
    --md-sys-color-secondary: #00695C;
    --md-sys-color-on-secondary: #FFFFFF;
    
    --md-sys-color-surface: #FFFFFF;
    --md-sys-color-surface-variant: #F5F5F5;
    --md-sys-color-on-surface: #1C1B1F;
    --md-sys-color-on-surface-variant: #49454F;
    
    --md-sys-color-outline: #79747E;
    --md-sys-color-outline-variant: #CAC4D0;
    
    --md-sys-color-background: #FEFBFF;
    --md-sys-color-error: #BA1A1A;
    
    /* Elevation */
    --md-sys-elevation-1: 0 1px 3px 1px rgba(0,0,0,0.15), 0 1px 2px 0 rgba(0,0,0,0.3);
    --md-sys-elevation-2: 0 2px 6px 2px rgba(0,0,0,0.15), 0 1px 2px 0 rgba(0,0,0,0.3);
    
    /* Shape */
    --md-sys-shape-corner-small: 8px;
    --md-sys-shape-corner-medium: 12px;
    --md-sys-shape-corner-large: 16px;
    --md-sys-shape-corner-full: 9999px;
}

body {
    font-family: 'Roboto', -apple-system, sans-serif;
    background: var(--md-sys-color-background);
    color: var(--md-sys-color-on-surface);
    line-height: 1.6;
}

/* ============================================================================
   ACCESSIBILITY STYLES
   ============================================================================ */

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}


/* Focus visible styles for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: 2px;
    border-radius: var(--md-sys-shape-corner-small);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: 2px;
}

/* Remove default focus for mouse users */
*:focus:not(:focus-visible) {
    outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    * {
        border-width: 2px !important;
    }

    button,
    .card {
        border: 2px solid currentColor !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Info Bar (User Agent + IP) - Now inside search widget */
.info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    background: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 12px;
    color: var(--md-sys-color-on-surface-variant);
    flex-wrap: wrap;
    width: 100%;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.info-label {
    color: var(--md-sys-color-primary);
    font-weight: 600;
}

.info-value {
    color: var(--md-sys-color-on-surface-variant);
    word-break: break-all;
    font-size: 11px;
}

#internet-protocolwidget {
    flex: 1;
    min-width: 200px;
    font-size: 11px;
}

.app-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.app-title h1 {
    font-size: 28px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
    text-align: center;
}

/* Terminal Footer (Coded by SABIN) - Inline in Info Bar */
.terminal-footer {
    position: relative;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 11px;
    color: #00ff41;
    background: rgba(0, 0, 0, 0.85);
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #00ff41;
    box-shadow: 0 0 8px rgba(0, 255, 65, 0.3),
                inset 0 0 8px rgba(0, 255, 65, 0.1);
    letter-spacing: 0.5px;
    backdrop-filter: blur(5px);
    opacity: 0;
    animation: fadeInFooter 1s ease-in 2s forwards, glitchShake 3s infinite;
    text-align: center;
    white-space: nowrap;
    flex-shrink: 0;
}

@keyframes fadeInFooter {
    to {
        opacity: 1;
    }
}

@keyframes glitchShake {
    0%, 90%, 100% {
        transform: translate(0, 0);
    }
    91% {
        transform: translate(-2px, 1px);
    }
    92% {
        transform: translate(2px, -1px);
    }
    93% {
        transform: translate(-1px, 2px);
    }
    94% {
        transform: translate(1px, -2px);
    }
    95% {
        transform: translate(-2px, -1px);
    }
    96% {
        transform: translate(2px, 1px);
    }
    97% {
        transform: translate(-1px, -1px);
    }
    98% {
        transform: translate(1px, 1px);
    }
    99% {
        transform: translate(0, 0);
    }
}

.terminal-footer::before {
    content: '> ';
    color: #00ff41;
    font-weight: bold;
}

.terminal-footer-line {
    display: block;
    line-height: 1.6;
}

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 14px;
    background: #00ff41;
    margin-left: 2px;
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.terminal-footer:hover {
    border-color: #00ffff;
    color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5),
                inset 0 0 15px rgba(0, 255, 255, 0.2);
    transform: scale(1.02);
    transition: all 0.3s ease;
    animation: fadeInFooter 1s ease-in 2s forwards, glitchShake 3s infinite, glitchIntense 0.3s ease;
}

@keyframes glitchIntense {
    0%, 100% { transform: translate(0, 0) scale(1.02); }
    25% { transform: translate(-3px, 2px) scale(1.02); }
    50% { transform: translate(3px, -2px) scale(1.02); }
    75% { transform: translate(-2px, -2px) scale(1.02); }
}

.terminal-footer:hover .terminal-cursor {
    background: #00ffff;
}

.terminal-footer-text {
    display: inline;
    white-space: nowrap;
}

/* FBI Confidential Style Highlighting */
.fbi-name {
    font-family: 'Courier New', 'Courier', monospace;
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8),
                 0 0 20px rgba(0, 255, 255, 0.4);
    background: linear-gradient(180deg, transparent 0%, rgba(0, 255, 255, 0.1) 50%, transparent 100%);
    padding: 0 4px;
    border-radius: 2px;
}

.fbi-email {
    font-family: 'Courier New', 'Courier', monospace;
    font-weight: 700;
    letter-spacing: 2px;
    color: #00ffff;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.6),
                 0 0 15px rgba(0, 255, 255, 0.3);
    background: linear-gradient(180deg, transparent 0%, rgba(0, 255, 255, 0.08) 50%, transparent 100%);
    padding: 0 3px;
    border-radius: 2px;
}

.terminal-footer:hover .fbi-name,
.terminal-footer:hover .fbi-email {
    color: #ffffff;
    text-shadow: 0 0 15px rgba(0, 255, 255, 1),
                 0 0 30px rgba(0, 255, 255, 0.6),
                 0 0 40px rgba(0, 255, 255, 0.4);
}

/* IP Widget Link (hidden but present in HTML) */
.internet-protocollink {
    font-size: 10px;
    color: var(--md-sys-color-on-surface-variant);
    text-align: right;
}

.internet-protocollink a {
    color: var(--md-sys-color-secondary);
    text-decoration: none;
}

.internet-protocollink a:hover {
    color: var(--md-sys-color-primary);
}

/* Hide the IP widget watermark completely */
.internet-protocollink {
    display: none !important;
}

/* IP Widget Custom Styling */
#internet-protocolwidget {
    background: transparent !important;
    color: var(--md-sys-color-on-surface) !important;
    font-family: inherit !important;
}

#internet-protocolwidget * {
    background: transparent !important;
    color: var(--md-sys-color-on-surface) !important;
    border-color: var(--md-sys-color-outline-variant) !important;
}

#internet-protocolwidget table {
    background: var(--md-sys-color-surface-container) !important;
    border-radius: var(--md-sys-shape-corner-medium) !important;
    padding: 8px !important;
    border: 1px solid var(--md-sys-color-outline-variant) !important;
}

#internet-protocolwidget td {
    padding: 4px 8px !important;
    color: var(--md-sys-color-on-surface-variant) !important;
    font-size: 11px !important;
}

#internet-protocolwidget strong,
#internet-protocolwidget b {
    color: var(--md-sys-color-primary) !important;
    font-weight: 600 !important;
}

#internet-protocolwidget a {
    color: var(--md-sys-color-secondary) !important;
    text-decoration: none !important;
}

#internet-protocolwidget a:hover {
    color: var(--md-sys-color-primary) !important;
}

.icon-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.icon-button:hover {
    background: var(--md-sys-color-surface-variant);
}

/* Container */
/* Main content - No footer padding needed */

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
}

/* Card */
.card {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    box-shadow: var(--md-sys-elevation-1);
    padding: 16px;
    transition: box-shadow 0.3s;
}

.card:hover {
    box-shadow: var(--md-sys-elevation-2);
}

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

.card-title {
    font-size: 18px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--md-sys-color-on-surface);
}

/* Search Widget */
.search-widget {
    grid-column: span 12;
}

.search-tabs {
    display: flex;
    gap: 8px;
}

.tab-button {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    border-radius: var(--md-sys-shape-corner-small);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.tab-button.active {
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.tab-button.ai-chatbot-btn {
    background: var(--md-sys-color-tertiary-container);
    color: var(--md-sys-color-on-tertiary-container);
    border: 1px solid var(--md-sys-color-outline-variant);
}

.tab-button.ai-chatbot-btn:hover {
    background: var(--md-sys-color-tertiary);
    color: var(--md-sys-color-on-tertiary);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-container {
    position: relative;
    margin-top: 16px;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--md-sys-color-on-surface-variant);
}

.search-input {
    width: 100%;
    padding: 16px 56px;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-full);
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    background: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface);
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
    background: var(--md-sys-color-surface);
    box-shadow: 0 0 0 3px rgba(11, 87, 208, 0.1);
}

/* Quick Search Buttons */
.quick-search-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding: 0 4px;
}

.quick-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-full);
    background: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface-variant);
    font-size: 13px;
    font-weight: 500;
    font-family: 'Roboto', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.quick-search-btn:hover {
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    border-color: var(--md-sys-color-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quick-search-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.quick-search-btn .btn-icon {
    font-size: 16px;
    line-height: 1;
}

.quick-search-btn .btn-text {
    font-size: 13px;
    line-height: 1;
}

/* Meta Search Results */
.meta-search-results {
    margin-top: 24px;
}

.engine-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    overflow-x: auto;
}

.engine-tab {
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.engine-tab.active {
    color: var(--md-sys-color-primary);
    border-bottom-color: var(--md-sys-color-primary);
}

.results-grid {
    display: grid;
    gap: 16px;
}

/* When displaying all engines in columns */
.results-grid:has(.engine-column) {
    grid-template-columns: repeat(3, 1fr);
}

/* When displaying single engine results */
.results-grid:not(:has(.engine-column)) {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* Engine column styling for 3-column layout */
.engine-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.engine-column-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--md-sys-color-primary);
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--md-sys-color-outline-variant);
}

.no-results {
    text-align: center;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 14px;
    padding: 16px;
    font-style: italic;
}

.result-item {
    padding: 12px;
    border-radius: var(--md-sys-shape-corner-medium);
    border: 1px solid var(--md-sys-color-outline-variant);
    transition: all 0.2s;
}

.result-item:hover {
    background: var(--md-sys-color-surface-variant);
    box-shadow: var(--md-sys-elevation-1);
}

.result-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--md-sys-shape-corner-small);
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 4px;
}

.result-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--md-sys-color-primary);
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
}

.result-title:hover {
    text-decoration: underline;
}

.result-snippet {
    font-size: 14px;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 4px;
}

.result-url {
    font-size: 12px;
    color: var(--md-sys-color-secondary);
}

/* Clock Widget */
.clock-widget {
    grid-column: span 4;
}

.clock-time {
    font-size: 36px;
    font-weight: 300;
    color: var(--md-sys-color-on-surface);
    line-height: 1;
    margin: 8px 0;
}

.clock-date {
    font-size: 13px;
    color: var(--md-sys-color-on-surface-variant);
}

/* Weather Widget */
.weather-widget {
    grid-column: span 4;
}

.weather-locations {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.weather-location {
    padding: 12px;
    background: var(--md-sys-color-surface-variant);
    border-radius: var(--md-sys-shape-corner-medium);
}

.weather-location-name {
    font-weight: 500;
    margin-bottom: 8px;
}

.weather-current {
    display: flex;
    align-items: center;
    gap: 12px;
}

.weather-icon {
    font-size: 32px;
}

.weather-temp {
    font-size: 28px;
    font-weight: 300;
}

.weather-details {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--md-sys-color-on-surface-variant);
}

/* Exchange Rates */
.rates-widget {
    grid-column: span 12;
}

.rates-section {
    margin-bottom: 12px;
}

.section-subtitle {
    font-size: 13px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 6px;
}

.rates-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.rate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: var(--md-sys-color-surface-variant);
    border-radius: var(--md-sys-shape-corner-small);
    cursor: pointer;
    transition: all 0.2s;
}

.rate-item:hover {
    background: var(--md-sys-color-primary-container);
}

.rate-pair {
    font-weight: 500;
    font-size: 12px;
}

.rate-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--md-sys-color-primary);
}

.rate-change {
    font-size: 11px;
    margin-left: 6px;
}

.rate-change.up {
    color: #00C853;
}

.rate-change.down {
    color: #D32F2F;
}

.chart-controls {
    display: flex;
    gap: 6px;
    margin: 10px 0 8px 0;
}

.chart-period-btn {
    padding: 6px 16px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-full);
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.chart-period-btn.active {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border-color: var(--md-sys-color-primary);
}

.chart-period-btn:hover:not(.active) {
    background: var(--md-sys-color-surface-variant);
}

/* Bookmarks */
.bookmarks-widget {
    grid-column: span 12;
}

.bookmarks-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.bookmark-folder {
    background: var(--md-sys-color-surface-variant);
    padding: 10px;
    border-radius: var(--md-sys-shape-corner-medium);
}

.folder-title {
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

.bookmark-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border-radius: var(--md-sys-shape-corner-small);
    text-decoration: none;
    color: var(--md-sys-color-on-surface);
    transition: background 0.2s;
    margin-bottom: 2px;
    font-size: 13px;
}

.bookmark-link:hover {
    background: var(--md-sys-color-surface);
}

.bookmark-icon {
    font-size: 16px;
}

/* RSS Widget */
.rss-widget {
    grid-column: span 4;
}

.rss-articles {
    height: 400px;
    max-height: 400px;
    overflow-y: auto;
}

.rss-article {
    padding: 12px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    margin-bottom: 8px;
    border-radius: var(--md-sys-shape-corner-medium);
    transition: all 0.2s;
}

.rss-article:hover {
    background: var(--md-sys-color-surface-variant);
    transform: translateX(4px);
}

.rss-article:last-child {
    border-bottom: none;
}

.rss-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.rss-meta {
    font-size: 12px;
    color: var(--md-sys-color-on-surface-variant);
}

.ai-summary {
    margin-top: 12px;
    padding: 10px;
    background: rgba(11, 87, 208, 0.05);
    border: 1px solid rgba(11, 87, 208, 0.2);
    border-radius: var(--md-sys-shape-corner-medium);
    font-size: 13px;
    line-height: 1.5;
}

/* Link Shortener */
.shortener-widget {
    grid-column: span 4;
}

.shortener-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.text-input {
    padding: 12px 16px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-medium);
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
}

.text-input:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
}

.short-result {
    padding: 12px;
    background: var(--md-sys-color-primary-container);
    border-radius: var(--md-sys-shape-corner-medium);
    margin-bottom: 16px;
    display: none;
}

.links-list {
    height: 250px;
    max-height: 250px;
    overflow-y: auto;
}

/* Chat Widget */
.chat-widget {
    grid-column: span 4;
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    margin-bottom: 16px;
    padding: 16px;
    background: var(--md-sys-color-surface-variant);
    border-radius: var(--md-sys-shape-corner-medium);
}

.chat-message {
    margin-bottom: 12px;
    padding: 12px;
    border-radius: var(--md-sys-shape-corner-medium);
}

.chat-message.user {
    background: var(--md-sys-color-primary-container);
    margin-left: 20%;
}

.chat-message.assistant {
    background: var(--md-sys-color-surface);
    margin-right: 20%;
    border: 1px solid var(--md-sys-color-outline-variant);
}

.chat-input-container {
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-medium);
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
}

.chat-input:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
}

.btn-primary {
    padding: 12px 24px;
    border: none;
    border-radius: var(--md-sys-shape-corner-medium);
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    box-shadow: var(--md-sys-elevation-1);
}

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

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--md-sys-color-on-surface-variant);
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--md-sys-color-outline-variant);
    border-top-color: var(--md-sys-color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Google Calendar Widget */
.calendar-widget {
    grid-column: 5 / span 8; /* Start at column 5, span 8 columns (right side) */
    grid-row: span 2; /* Span 2 rows to match Clock + Weather height */
}

.calendar-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding: 0 4px;
}

.calendar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-full);
    background: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface-variant);
    font-size: 14px;
    font-weight: 500;
    font-family: 'Roboto', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.calendar-btn:hover {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    border-color: var(--md-sys-color-secondary);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calendar-btn.active {
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    border-color: var(--md-sys-color-primary);
    font-weight: 600;
}

.calendar-container {
    border-radius: var(--md-sys-shape-corner-medium);
    overflow: hidden;
    background: var(--md-sys-color-surface);
    min-height: 600px;
}

.calendar-container #calendar {
    padding: 16px;
}

/* FullCalendar MD3 Styling */
.fc {
    font-family: 'Roboto', sans-serif;
}

.fc .fc-button-primary {
    background: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.fc .fc-button-primary:hover {
    background: var(--md-sys-color-primary-container);
    border-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary-container);
}

.fc .fc-button-primary:disabled {
    opacity: 0.5;
}

.fc-theme-standard td,
.fc-theme-standard th {
    border-color: var(--md-sys-color-outline-variant);
}

.fc-daygrid-day-number {
    color: var(--md-sys-color-on-surface);
}

.fc-col-header-cell-cushion {
    color: var(--md-sys-color-on-surface-variant);
}

/* Responsive */
@media (max-width: 768px) {
    .search-widget,
    .clock-widget,
    .weather-widget,
    .calendar-widget,
    .rates-widget,
    .bookmarks-widget,
    .rss-widget,
    .shortener-widget,
    .chat-widget {
        grid-column: span 12 !important;
        grid-row: auto !important;
    }

    .results-grid,
    .weather-locations,
    .rates-grid,
    .rates-list {
        grid-template-columns: 1fr;
    }

    .info-bar {
        flex-direction: column;
        gap: 12px;
    }

    .terminal-footer {
        font-size: 10px;
        padding: 5px 10px;
    }

    .bookmarks-container {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        gap: 16px;
    }

    .card {
        padding: 12px;
    }
}
