/* assets/css/3-components.css */

/* --- Surface Card (Generic) --- */
.surface-card {
    background-color: var(--bg-panel);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);
    padding: 40px;
}

/* --- Stream Cards (Google Style) --- */
.stream-card {
    background-color: var(--bg-panel);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    /* Cleaner look */
}

@media (max-width: 768px) {
    .stream-card {
        padding: 20px;
        margin-left: 0;
        margin-right: 0;
    }
}

.stream-card:hover {
    background-color: var(--bg-app);
    box-shadow: var(--shadow-soft);
    transform: translateY(-2px);
}

.card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
    font-weight: 500;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 12px;
    display: block;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.card-title:hover {
    background: var(--gradient-gemini);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.card-excerpt {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 24px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: var(--bg-panel-hover);
    border-radius: 20px;
    /* Pill shape */
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

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

/* --- Widgets --- */
.widget-card {
    background-color: var(--bg-panel);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.time-widget {
    align-items: flex-start;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
}

.time-display {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: var(--font-mono);
    line-height: 1;
    letter-spacing: -0.05em;
    background: var(--gradient-gemini);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.date-display {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 4px;
}

.profile-widget .avatar {
    width: 48px;
    height: 48px;
    background-color: var(--accent-secondary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
}

.profile-header {
    display: flex;
    gap: 16px;
    align-items: center;
}

.profile-header h3 {
    font-size: 1.1rem;
    margin: 0;
}

.profile-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.promo-card {
    background-color: #e8f0fe;
    /* Light blue tint */
    color: var(--accent-primary);
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
}

.promo-card:hover {
    background-color: #d2e3fc;
}

/* --- Code Blocks (Mac Style) --- */
pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 48px 24px 24px 24px;
    /* Top padding for window controls */
    border-radius: 12px;
    overflow-x: auto;
    position: relative;
    margin-bottom: 24px;
    box-shadow: var(--shadow-soft);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.5;
    border: 1px solid var(--border-subtle);
}

/* Window Controls (Red/Yellow/Green dots) */
pre::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 16px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff5f56;
    /* Red */
    box-shadow: 20px 0 0 #ffbd2e, 40px 0 0 #27c93f;
    /* Yellow, Green */
}

/* Inline code elements */
code {
    font-family: var(--font-mono);
    background-color: var(--code-inline-bg);
    color: var(--code-inline-text);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Code inside pre blocks should not have inline styling */
pre code {
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
}

/* Copy Button */
.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    background: rgba(60, 64, 67, 0.1);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0;
    z-index: 10;
    backdrop-filter: blur(4px);
}

[data-theme="dark"] .copy-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #e3e3e3;
}

pre:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.copy-btn.copied {
    background: #27c93f;
    color: white;
    border-color: #27c93f;
}

/* --- Category Widget Styles --- */
.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.category-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: var(--bg-panel-hover);
    border-radius: 16px;
    font-size: 0.85rem;
    color: var(--text-main);
    transition: all 0.2s;
    text-decoration: none;
}

.category-tag:hover {
    background-color: var(--accent-primary);
    color: white;
    transform: translateY(-1px);
}

.category-count {
    background-color: var(--border-subtle);
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.category-tag:hover .category-count {
    background-color: rgba(255, 255, 255, 0.3);
    color: white;
}

/* --- Command Palette --- */
.cmd-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}

.cmd-overlay.active {
    display: flex;
}

.cmd-palette {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 600px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.cmd-input {
    width: 100%;
    padding: 20px 24px;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-size: 1.1rem;
    font-family: var(--font-sans);
    outline: none;
    border-bottom: 1px solid var(--border-subtle);
}

.cmd-input::placeholder {
    color: var(--text-dim);
}

.cmd-results {
    max-height: 400px;
    overflow-y: auto;
}

.cmd-result-item {
    padding: 16px 24px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid var(--border-subtle);
}

.cmd-result-item:last-child {
    border-bottom: none;
}

.cmd-result-item:hover,
.cmd-result-item.selected {
    background: var(--bg-panel-hover);
}

.cmd-result-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 4px;
}

.cmd-result-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.cmd-empty {
    padding: 40px 24px;
    text-align: center;
    color: var(--text-dim);
}

/* Keyboard Help Modal */
.keyboard-help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.keyboard-help-modal.active {
    display: flex;
}

.keyboard-help-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.keyboard-help-content {
    position: relative;
    background: var(--bg-app);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

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

.keyboard-help-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-subtle);
}

.keyboard-help-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
}

.keyboard-help-header h2 i {
    color: var(--accent-primary);
}

.keyboard-help-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.keyboard-help-close:hover {
    background: var(--bg-panel-hover);
    color: var(--text-main);
}

.keyboard-help-body {
    padding: 24px 28px;
}

.shortcut-section {
    margin-bottom: 32px;
}

.shortcut-section:last-child {
    margin-bottom: 0;
}

.shortcut-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.shortcut-item:last-child {
    border-bottom: none;
}

.shortcut-keys {
    display: flex;
    gap: 6px;
    align-items: center;
    font-weight: 500;
    color: var(--text-main);
}

.shortcut-keys kbd {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 4px 8px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    min-width: 32px;
    text-align: center;
    display: inline-block;
}

.shortcut-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .keyboard-help-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .keyboard-help-header,
    .keyboard-help-body {
        padding: 20px;
    }
    
    .shortcut-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
