/* Material Design Theme + Dark Mode */
:root {
    --mdc-theme-primary: #6200ee;
    --mdc-theme-secondary: #03dac6;
    --mdc-theme-background: #ffffff;
    --mdc-theme-surface: #ffffff;
    --mdc-theme-error: #b00020;
    --mdc-theme-text-primary: rgba(0, 0, 0, 0.87);
    --mdc-theme-text-secondary: rgba(0, 0, 0, 0.6);
    --mdc-theme-divider: rgba(0, 0, 0, 0.12);
    --mdc-theme-snackbar: #323232;
    --mdc-theme-on-primary: #ffffff;
    --mdc-theme-on-surface: rgba(0, 0, 0, 0.87);
    --mdc-elevation-transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    --mdc-elevation-umbra: 0px 2px 1px -1px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 1px 3px 0px rgba(0,0,0,0.12);
    --mdc-elevation-penumbra: 0px 3px 4px 0px rgba(0,0,0,0.2), 0px 1px 8px 0px rgba(0,0,0,0.12);
    --mdc-elevation-ambient: 0px 1px 5px 0px rgba(0,0,0,0.12);
    --mdc-elevation-overlay: 0px 4px 5px 0px rgba(0,0,0,0.14), 0px 1px 10px 0px rgba(0,0,0,0.12);
    --mdc-elevation: 0 2px 4px -1px rgba(0,0,0,0.2), 0 4px 5px 0 rgba(0,0,0,0.14), 0 1px 10px 0 rgba(0,0,0,0.12);
}

/* Dark Mode */
[data-theme="dark"] {
    --mdc-theme-background: #121212;
    --mdc-theme-surface: #1e1e1e;
    --mdc-theme-text-primary: #ffffff;
    --mdc-theme-text-secondary: rgba(255, 255, 255, 0.7);
    --mdc-theme-divider: rgba(255, 255, 255, 0.12);
    --mdc-theme-snackbar: #323232;
    --mdc-elevation-umbra: 0px 2px 1px -1px rgba(0,0,0,0.4), 0px 1px 1px 0px rgba(0,0,0,0.24), 0px 1px 3px 0px rgba(0,0,0,0.22);
    --mdc-elevation-penumbra: 0px 3px 4px 0px rgba(0,0,0,0.4), 0px 1px 8px 0px rgba(0,0,0,0.22);
    --mdc-elevation-ambient: 0px 1px 5px 0px rgba(0,0,0,0.22);
    --mdc-elevation: 0 2px 4px -1px rgba(0,0,0,0.4), 0 4px 5px 0 rgba(0,0,0,0.24), 0 1px 10px 0 rgba(0,0,0,0.22);
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-family: 'Roboto', 'Noto Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color-scheme: light dark;
}

body {
    background-color: var(--mdc-theme-background);
    color: var(--mdc-theme-text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    line-height: 1.5;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }

p {
    color: var(--mdc-theme-text-secondary);
    margin-bottom: 1rem;
}

a {
    color: var(--mdc-theme-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--mdc-theme-secondary);
    text-decoration: underline;
}

/* Cards */
.card {
    background-color: var(--mdc-theme-surface);
    border-radius: 8px;
    box-shadow: var(--mdc-elevation);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: none;
    transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s ease;
}

.card:hover {
    box-shadow: var(--mdc-elevation-overlay);
    transform: translateY(-2px);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--mdc-theme-text-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.02857em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--mdc-theme-primary);
    color: var(--mdc-theme-on-primary);
}

.btn-primary:hover {
    background-color: #3700b3;
    box-shadow: 0 2px 4px -1px rgba(98, 0, 238, 0.4);
}

.btn-secondary {
    background-color: var(--mdc-theme-secondary);
    color: #000;
}

.btn-secondary:hover {
    background-color: #02b3a1;
}

.btn-danger {
    background-color: var(--mdc-theme-error);
    color: white;
}

.btn-danger:hover {
    background-color: #8c001a;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--mdc-theme-text-secondary);
    color: var(--mdc-theme-text-primary);
}

.btn-outline:hover {
    background-color: rgba(98, 0, 238, 0.1);
}

.btn-icon {
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--mdc-theme-text-secondary);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--mdc-theme-text-primary);
    background-color: var(--mdc-theme-surface);
    border: 1px solid var(--mdc-theme-divider);
    border-radius: 4px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--mdc-theme-primary);
    box-shadow: 0 0 0 2px rgba(98, 0, 238, 0.2);
}

.form-control::placeholder {
    color: var(--mdc-theme-text-secondary);
}

/* Alerts */
.alert {
    padding: 0.75rem 1.25rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: none;
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.alert-warning {
    background-color: rgba(251, 146, 60, 0.1);
    color: #f59e0b;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background-color: var(--mdc-theme-surface);
    border: 1px solid var(--mdc-theme-divider);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--mdc-elevation);
    transition: all 0.2s ease;
    z-index: 1000;
}

.theme-toggle:hover {
    box-shadow: var(--mdc-elevation-overlay);
    transform: scale(1.05);
}

.theme-toggle .material-icons {
    font-size: 1.5rem;
    color: var(--mdc-theme-text-primary);
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--mdc-theme-surface);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.table th {
    background-color: var(--mdc-theme-background);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 500;
    color: var(--mdc-theme-text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03333em;
    border-bottom: 1px solid var(--mdc-theme-divider);
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--mdc-theme-divider);
    color: var(--mdc-theme-text-primary);
}

.table tr:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

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

.table-actions .btn-icon {
    width: 32px;
    height: 32px;
}

/* Header */
.header {
    margin-bottom: 2rem;
}

.header h1 {
    color: var(--mdc-theme-primary);
}

/* User Badge */
.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--mdc-theme-primary);
    color: var(--mdc-theme-on-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
}

.user-badge .material-icons {
    font-size: 1rem;
}

/* Divider */
.divider {
    height: 1px;
    background-color: var(--mdc-theme-divider);
    margin: 1.5rem 0;
}

/* Responsive */
@media (max-width: 768px) {
    .card {
        padding: 1rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    
    .theme-toggle {
        width: 40px;
        height: 40px;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card, .alert {
    animation: fadeIn 0.3s ease-out;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--mdc-theme-background);
}

::-webkit-scrollbar-thumb {
    background: var(--mdc-theme-divider);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--mdc-theme-text-secondary);
}
