/* Material Design 3 Watchface Tool Styles */

/* ==================== */
/* CSS Variables - MD3 Color System */
/* ==================== */
:root {
    /* Primary Colors */
    --md-sys-color-primary: #6750A4;
    --md-sys-color-on-primary: #FFFFFF;
    --md-sys-color-primary-container: #EADDFF;
    --md-sys-color-on-primary-container: #21005D;
    
    /* Secondary Colors */
    --md-sys-color-secondary: #625B71;
    --md-sys-color-on-secondary: #FFFFFF;
    --md-sys-color-secondary-container: #E8DEF8;
    --md-sys-color-on-secondary-container: #1D192B;
    
    /* Tertiary Colors */
    --md-sys-color-tertiary: #7D5260;
    --md-sys-color-on-tertiary: #FFFFFF;
    --md-sys-color-tertiary-container: #FFD8E4;
    --md-sys-color-on-tertiary-container: #31111D;
    
    /* Error Colors */
    --md-sys-color-error: #B3261E;
    --md-sys-color-on-error: #FFFFFF;
    --md-sys-color-error-container: #F9DEDC;
    --md-sys-color-on-error-container: #410E0B;
    
    /* Surface Colors */
    --md-sys-color-surface: #FFFBFE;
    --md-sys-color-on-surface: #1C1B1F;
    --md-sys-color-surface-variant: #E7E0EC;
    --md-sys-color-on-surface-variant: #49454F;
    --md-sys-color-outline: #79747E;
    --md-sys-color-outline-variant: #CAC4D0;
    
    /* Background */
    --md-sys-color-background: #FFFBFE;
    --md-sys-color-on-background: #1C1B1F;
    
    /* Surface Container */
    --md-sys-color-surface-container-lowest: #FFFFFF;
    --md-sys-color-surface-container-low: #F7F2FA;
    --md-sys-color-surface-container: #F3EDF7;
    --md-sys-color-surface-container-high: #ECE6F0;
    --md-sys-color-surface-container-highest: #E6E0E9;
    
    /* Elevation */
    --md-sys-elevation-1: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px 1px rgba(0,0,0,0.15);
    --md-sys-elevation-2: 0 1px 2px rgba(0,0,0,0.3), 0 2px 6px 2px rgba(0,0,0,0.15);
    --md-sys-elevation-3: 0 4px 8px 3px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.3);
    --md-sys-elevation-4: 0 6px 10px 4px rgba(0,0,0,0.15), 0 2px 3px rgba(0,0,0,0.3);
    --md-sys-elevation-5: 0 8px 12px 6px rgba(0,0,0,0.15), 0 4px 4px rgba(0,0,0,0.3);
    
    /* Shape */
    --md-sys-shape-corner-none: 0;
    --md-sys-shape-corner-extra-small: 4px;
    --md-sys-shape-corner-small: 8px;
    --md-sys-shape-corner-medium: 12px;
    --md-sys-shape-corner-large: 16px;
    --md-sys-shape-corner-extra-large: 28px;
    
    /* Typography (Roboto) */
    --md-sys-typescale-display-large-size: 57px;
    --md-sys-typescale-display-medium-size: 45px;
    --md-sys-typescale-display-small-size: 36px;
    --md-sys-typescale-headline-large-size: 32px;
    --md-sys-typescale-headline-medium-size: 28px;
    --md-sys-typescale-headline-small-size: 24px;
    --md-sys-typescale-title-large-size: 22px;
    --md-sys-typescale-title-medium-size: 16px;
    --md-sys-typescale-title-small-size: 14px;
    --md-sys-typescale-body-large-size: 16px;
    --md-sys-typescale-body-medium-size: 14px;
    --md-sys-typescale-body-small-size: 12px;
    --md-sys-typescale-label-large-size: 14px;
    --md-sys-typescale-label-medium-size: 12px;
    --md-sys-typescale-label-small-size: 11px;
}

/* Dark Theme */
[data-theme="dark"] {
    --md-sys-color-primary: #D0BCFF;
    --md-sys-color-on-primary: #381E72;
    --md-sys-color-primary-container: #4F378B;
    --md-sys-color-on-primary-container: #EADDFF;
    
    --md-sys-color-secondary: #CCC2DC;
    --md-sys-color-on-secondary: #332D41;
    --md-sys-color-secondary-container: #4A4458;
    --md-sys-color-on-secondary-container: #E8DEF8;
    
    --md-sys-color-tertiary: #EFB8C8;
    --md-sys-color-on-tertiary: #492532;
    --md-sys-color-tertiary-container: #633B48;
    --md-sys-color-on-tertiary-container: #FFD8E4;
    
    --md-sys-color-error: #F2B8B5;
    --md-sys-color-on-error: #601410;
    --md-sys-color-error-container: #8C1D18;
    --md-sys-color-on-error-container: #F9DEDC;
    
    --md-sys-color-surface: #1C1B1F;
    --md-sys-color-on-surface: #E6E1E5;
    --md-sys-color-surface-variant: #49454F;
    --md-sys-color-on-surface-variant: #CAC4D0;
    --md-sys-color-outline: #938F99;
    --md-sys-color-outline-variant: #49454F;
    
    --md-sys-color-background: #1C1B1F;
    --md-sys-color-on-background: #E6E1E5;
    
    --md-sys-color-surface-container-lowest: #0F0D13;
    --md-sys-color-surface-container-low: #1D1B20;
    --md-sys-color-surface-container: #211F26;
    --md-sys-color-surface-container-high: #2B2930;
    --md-sys-color-surface-container-highest: #36343B;
}

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

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: var(--md-sys-typescale-body-medium-size);
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==================== */
/* Top App Bar */
/* ==================== */
.top-app-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    box-shadow: var(--md-sys-elevation-2);
    z-index: 100;
}

.app-bar-container {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 4px 0 4px;
    max-width: 100%;
}

.app-bar-title {
    flex: 1;
    font-size: var(--md-sys-typescale-title-large-size);
    font-weight: 500;
    margin-left: 12px;
}

.app-bar-actions {
    display: flex;
    gap: 4px;
}

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

.icon-button:hover {
    background-color: rgba(103, 80, 164, 0.08);
}

.icon-button:active {
    background-color: rgba(103, 80, 164, 0.12);
}

.icon-button .material-icons {
    font-size: 24px;
}

/* ==================== */
/* Navigation Drawer */
/* ==================== */
.navigation-drawer {
    position: fixed;
    top: 64px;
    left: -280px;
    width: 280px;
    height: calc(100vh - 64px);
    background-color: var(--md-sys-color-surface-container-low);
    box-shadow: var(--md-sys-elevation-1);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 90;
    overflow-y: auto;
}

.navigation-drawer.open {
    left: 0;
}

.drawer-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.drawer-header h2 {
    font-size: var(--md-sys-typescale-title-medium-size);
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
}

.drawer-content {
    padding: 12px 0;
}

.drawer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--md-sys-color-on-surface-variant);
    text-decoration: none;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

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

.drawer-item.active {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

.drawer-item .material-icons {
    font-size: 24px;
}

.drawer-divider {
    height: 1px;
    background-color: var(--md-sys-color-outline-variant);
    margin: 8px 0;
}

/* ==================== */
/* Backdrop */
/* ==================== */
.backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 80;
}

.backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* ==================== */
/* Main Content */
/* ==================== */
.main-content {
    margin-top: 64px;
    padding: 24px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-title {
    font-size: var(--md-sys-typescale-headline-medium-size);
    font-weight: 500;
    margin-bottom: 24px;
    color: var(--md-sys-color-on-background);
}

/* ==================== */
/* Filter Section */
/* ==================== */
.filter-section {
    margin-bottom: 24px;
}

.section-title {
    font-size: var(--md-sys-typescale-title-medium-size);
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--md-sys-color-on-background);
}

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface-variant);
    font-size: var(--md-sys-typescale-label-large-size);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.chip:hover {
    background-color: var(--md-sys-color-surface-container-highest);
}

.chip.active {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    border-color: var(--md-sys-color-secondary-container);
}

/* ==================== */
/* Sort Section */
/* ==================== */
.sort-section {
    margin-bottom: 24px;
}

.sort-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--md-sys-color-surface-variant);
}

.sort-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    font-size: var(--md-sys-typescale-label-large-size);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.sort-tab:hover {
    background-color: var(--md-sys-color-surface-container-highest);
}

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

.sort-tab .material-icons {
    font-size: 20px;
}

/* ==================== */
/* Watchface Grid */
/* ==================== */
.watchface-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.watchface-card {
    background-color: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-large);
    overflow: hidden;
    box-shadow: var(--md-sys-elevation-1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.watchface-card:hover {
    box-shadow: var(--md-sys-elevation-3);
    transform: translateY(-4px);
}

.watchface-card-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
    background-color: var(--md-sys-color-surface-variant);
}

.watchface-card-content {
    padding: 16px;
}

.watchface-card-title {
    font-size: var(--md-sys-typescale-title-medium-size);
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--md-sys-color-on-surface);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.watchface-card-author {
    font-size: var(--md-sys-typescale-body-small-size);
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 8px;
}

.watchface-card-desc {
    font-size: var(--md-sys-typescale-body-small-size);
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.watchface-card-stats {
    display: flex;
    gap: 16px;
    font-size: var(--md-sys-typescale-label-small-size);
    color: var(--md-sys-color-on-surface-variant);
}

.watchface-card-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.watchface-card-stat .material-icons {
    font-size: 16px;
}

/* Resource Card Actions */
.resource-card-actions {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    border-top: 1px solid var(--md-sys-color-outline-variant);
}

.resource-card-actions button {
    flex: 1;
}

/* ==================== */
/* Loading */
/* ==================== */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    grid-column: 1 / -1;
}

.circular-progress {
    width: 48px;
    height: 48px;
    border: 4px solid var(--md-sys-color-surface-variant);
    border-top-color: var(--md-sys-color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-container p {
    margin-top: 16px;
    color: var(--md-sys-color-on-surface-variant);
}

/* ==================== */
/* Load More */
/* ==================== */
.load-more-container {
    display: flex;
    justify-content: center;
    padding: 24px 0;
}

/* ==================== */
/* Buttons */
/* ==================== */
.button-filled {
    padding: 10px 24px;
    border: none;
    border-radius: var(--md-sys-shape-corner-large);
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    font-size: var(--md-sys-typescale-label-large-size);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--md-sys-elevation-1);
}

.button-filled:hover {
    box-shadow: var(--md-sys-elevation-2);
    background-color: color-mix(in srgb, var(--md-sys-color-primary) 90%, white);
}

.button-filled:active {
    box-shadow: var(--md-sys-elevation-1);
}

.button-outlined {
    padding: 10px 24px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-large);
    background-color: transparent;
    color: var(--md-sys-color-primary);
    font-size: var(--md-sys-typescale-label-large-size);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.button-outlined:hover {
    background-color: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent);
}

.button-outlined:active {
    background-color: color-mix(in srgb, var(--md-sys-color-primary) 12%, transparent);
}

.button-text {
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: var(--md-sys-color-primary);
    font-size: var(--md-sys-typescale-label-large-size);
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--md-sys-shape-corner-large);
    transition: all 0.2s ease;
}

.button-text:hover {
    background-color: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent);
}

/* ==================== */
/* FAB */
/* ==================== */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border: none;
    border-radius: var(--md-sys-shape-corner-large);
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    box-shadow: var(--md-sys-elevation-3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
}

.fab:hover {
    box-shadow: var(--md-sys-elevation-4);
    transform: scale(1.05);
}

.fab:active {
    box-shadow: var(--md-sys-elevation-2);
    transform: scale(0.95);
}

.fab .material-icons {
    font-size: 24px;
}

/* ==================== */
/* Upload Page */
/* ==================== */
.upload-container {
    max-width: 800px;
    margin: 0 auto;
}

.upload-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.upload-area {
    border: 2px dashed var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-large);
    padding: 48px 24px;
    text-align: center;
    background-color: var(--md-sys-color-surface-container-low);
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--md-sys-color-primary);
    background-color: var(--md-sys-color-surface-container);
}

.upload-area.drag-over {
    border-color: var(--md-sys-color-primary);
    background-color: var(--md-sys-color-primary-container);
}

.upload-icon {
    font-size: 64px !important;
    color: var(--md-sys-color-primary);
    margin-bottom: 16px;
}

.upload-area h3 {
    font-size: var(--md-sys-typescale-title-medium-size);
    margin-bottom: 8px;
    color: var(--md-sys-color-on-surface);
}

.upload-area p {
    font-size: var(--md-sys-typescale-body-medium-size);
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 16px;
}

/* Preview Upload Section */
.preview-upload-section {
    background-color: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-large);
    padding: 24px;
}

.preview-upload-section h3 {
    font-size: var(--md-sys-typescale-title-medium-size);
    margin-bottom: 16px;
    color: var(--md-sys-color-on-surface);
}

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

.preview-upload-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preview-upload-item label {
    font-size: var(--md-sys-typescale-label-medium-size);
    color: var(--md-sys-color-on-surface-variant);
}

.preview-upload-item input[type="file"] {
    font-size: var(--md-sys-typescale-body-small-size);
}

.preview-placeholder {
    width: 100%;
    height: 150px;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--md-sys-color-surface-variant);
    overflow: hidden;
}

.preview-placeholder .material-icons {
    font-size: 48px;
    color: var(--md-sys-color-on-surface-variant);
}

.preview-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Form */
.upload-form {
    background-color: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-large);
    padding: 24px;
}

.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    font-size: var(--md-sys-typescale-body-medium-size);
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--md-sys-color-on-surface);
}

.form-field input[type="text"],
.form-field textarea,
.form-field select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    font-size: var(--md-sys-typescale-body-large-size);
    font-family: 'Roboto', sans-serif;
    transition: all 0.2s ease;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--md-sys-color-primary) 12%, transparent);
}

.checkbox-field {
    display: flex;
    align-items: center;
}

.checkbox-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin: 0;
}

.checkbox-field input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ==================== */
/* Dialog */
/* ==================== */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
}

.dialog-overlay.show {
    opacity: 1;
    visibility: visible;
}

.dialog {
    background-color: var(--md-sys-color-surface-container-high);
    border-radius: var(--md-sys-shape-corner-extra-large);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--md-sys-elevation-5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dialog-overlay.show .dialog {
    transform: scale(1);
}

.dialog-large {
    max-width: 900px;
}

.dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.dialog-header h3 {
    font-size: var(--md-sys-typescale-headline-small-size);
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
}

.dialog-content {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(80vh - 120px);
}

/* Detail Dialog Content */
.detail-preview {
    text-align: center;
    margin-bottom: 24px;
}

.detail-preview img {
    max-width: 100%;
    border-radius: var(--md-sys-shape-corner-large);
    box-shadow: var(--md-sys-elevation-2);
}

.detail-info {
    margin-bottom: 24px;
}

.detail-info-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.detail-info-label {
    flex: 0 0 120px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
}

.detail-info-value {
    flex: 1;
    color: var(--md-sys-color-on-surface);
}

.detail-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.detail-actions button {
    flex: 1;
}

/* Comments Section */
.comments-section {
    margin-top: 24px;
}

.comments-section h4 {
    font-size: var(--md-sys-typescale-title-medium-size);
    margin-bottom: 16px;
    color: var(--md-sys-color-on-surface);
}

.comment-form {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.comment-form textarea {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-medium);
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    font-family: 'Roboto', sans-serif;
    resize: vertical;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    background-color: var(--md-sys-color-surface-container-low);
    border-radius: var(--md-sys-shape-corner-medium);
    margin-bottom: 12px;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--md-sys-color-primary-container);
    overflow: hidden;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.comment-author {
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
}

.comment-time {
    font-size: var(--md-sys-typescale-label-small-size);
    color: var(--md-sys-color-on-surface-variant);
}

.comment-text {
    color: var(--md-sys-color-on-surface-variant);
}

.comment-delete {
    align-self: flex-start;
}

/* ==================== */
/* Snackbar */
/* ==================== */
.snackbar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: var(--md-sys-color-inverse-surface);
    color: var(--md-sys-color-inverse-on-surface);
    padding: 14px 16px;
    border-radius: var(--md-sys-shape-corner-small);
    box-shadow: var(--md-sys-elevation-3);
    z-index: 2000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 90%;
}

.snackbar.show {
    transform: translateX(-50%) translateY(0);
}

/* Missing inverse colors */
:root {
    --md-sys-color-inverse-surface: #313033;
    --md-sys-color-inverse-on-surface: #F4EFF4;
}

[data-theme="dark"] {
    --md-sys-color-inverse-surface: #E6E1E5;
    --md-sys-color-inverse-on-surface: #313033;
}

/* ==================== */
/* Responsive Design */
/* ==================== */
@media (max-width: 768px) {
    .main-content {
        padding: 16px;
    }
    
    .watchface-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .watchface-card-image {
        height: 180px;
    }
    
    .watchface-card-content {
        padding: 12px;
    }
    
    .preview-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .dialog {
        width: 95%;
    }
    
    .sort-tab {
        padding: 12px 16px;
    }
    
    .sort-tab span:not(.material-icons) {
        display: none;
    }
}

@media (min-width: 1024px) {
    .navigation-drawer {
        left: 0;
    }
    
    .main-content {
        margin-left: 280px;
    }
    
    .menu-button {
        display: none;
    }
    
    .backdrop {
        display: none;
    }
}

/* ==================== */
/* Utilities */
/* ==================== */
.text-center {
    text-align: center;
}

.mt-16 {
    margin-top: 16px;
}

.mb-16 {
    margin-bottom: 16px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--md-sys-color-on-surface-variant);
}

.empty-state .material-icons {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: var(--md-sys-typescale-title-large-size);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: var(--md-sys-typescale-body-medium-size);
}
