:root {
    /* Light Mode - Horror Theme */
    --primary: #8B0000;
    --primary-dark: #5C0000;
    --primary-light: #B22222;
    --secondary: #DC143C;
    --success: #228B22;
    --warning: #FF8C00;
    --danger: #8B0000;
    --dark: #1a0000;
    --gray-900: #1F1F1F;
    --gray-800: #2D2D2D;
    --gray-700: #3F3F3F;
    --gray-600: #4B4B4B;
    --gray-500: #666666;
    --gray-400: #999999;
    --gray-300: #CCCCCC;
    --gray-200: #E5E5E5;
    --gray-100: #F3F3F3;
    --gray-50: #F9F9F9;
    --white: #FFFFFF;
    --background: #FFF5F5;
    --card-bg: #FFFFFF;
    --text-primary: #1F1F1F;
    --text-secondary: #666666;
    --shadow-sm: 0 1px 2px rgba(139,0,0,0.1);
    --shadow: 0 4px 6px -1px rgba(139,0,0,0.15), 0 2px 4px -1px rgba(139,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(139,0,0,0.2), 0 4px 6px -2px rgba(139,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(139,0,0,0.25), 0 10px 10px -5px rgba(139,0,0,0.1);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

[data-theme="dark"] {
    /* Dark Mode - Horror Theme */
    --primary: #B22222;
    --primary-dark: #DC143C;
    --primary-light: #CD5C5C;
    --secondary: #FF6347;
    --success: #32CD32;
    --warning: #FFA500;
    --danger: #DC143C;
    --dark: #0a0000;
    --gray-900: #E5E5E5;
    --gray-800: #CCCCCC;
    --gray-700: #B3B3B3;
    --gray-600: #999999;
    --gray-500: #808080;
    --gray-400: #666666;
    --gray-300: #4D4D4D;
    --gray-200: #333333;
    --gray-100: #1F1F1F;
    --gray-50: #1a0000;
    --white: #0d0000;
    --background: #0d0000;
    --card-bg: #1a0000;
    --text-primary: #E5E5E5;
    --text-secondary: #B3B3B3;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.6), 0 2px 4px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.7), 0 4px 6px -2px rgba(0,0,0,0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.8), 0 10px 10px -5px rgba(0,0,0,0.6);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 80px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header */
.app-header {
    background: var(--card-bg);
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--gray-200);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-content {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.app-logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.app-logo-text {
    font-weight: 700;
    font-size: 18px;
    color: var(--text-primary);
}

/* Theme Toggle */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 2px solid var(--gray-300);
    background: var(--card-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: rotate(15deg);
}

/* Back Button */
.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
}

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

/* Main Content */
.app-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-top: 1px solid var(--gray-200);
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 100;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.bottom-nav-content {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius);
    transition: all 0.2s;
    min-width: 64px;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item:hover {
    color: var(--primary);
    background: var(--gray-100);
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 11px;
    font-weight: 500;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.card-body {
    padding: 20px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 14px rgba(139, 0, 0, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 0, 0, 0.5);
    color: white;
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

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

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

.btn-success {
    background: linear-gradient(135deg, var(--success), #1a7a1a);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #5C0000);
    color: white;
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-sm {
    padding: 10px 16px;
    font-size: 13px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s;
    background: var(--card-bg);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(139, 0, 0, 0.1);
}

.form-control::placeholder {
    color: var(--gray-400);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 44px;
}

.form-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-primary {
    background: rgba(139, 0, 0, 0.15);
    color: var(--primary);
}

.badge-success {
    background: rgba(34, 139, 34, 0.15);
    color: var(--success);
}

.badge-warning {
    background: rgba(255, 140, 0, 0.15);
    color: var(--warning);
}

.badge-danger {
    background: rgba(139, 0, 0, 0.15);
    color: var(--danger);
}

.badge-gray {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* Section Title */
.section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding: 0 4px;
}

/* Page Title */
.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Alert */
.alert {
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-success {
    background: rgba(34, 139, 34, 0.15);
    color: #1a7a1a;
}

[data-theme="dark"] .alert-success {
    background: rgba(34, 139, 34, 0.25);
    color: #32CD32;
}

.alert-danger, .alert-error {
    background: rgba(139, 0, 0, 0.15);
    color: #5C0000;
}

[data-theme="dark"] .alert-danger,
[data-theme="dark"] .alert-error {
    background: rgba(220, 20, 60, 0.25);
    color: #DC143C;
}

.alert-warning {
    background: rgba(255, 140, 0, 0.15);
    color: #CC7000;
}

[data-theme="dark"] .alert-warning {
    background: rgba(255, 140, 0, 0.25);
    color: #FFA500;
}

.alert-info {
    background: rgba(139, 0, 0, 0.15);
    color: var(--primary-dark);
}

.alert i {
    font-size: 18px;
    margin-top: 2px;
}

/* Divider */
.divider {
    height: 1px;
    background: var(--gray-200);
    margin: 20px 0;
}

/* Info Row */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* List Item */
.list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--card-bg);
    border-radius: var(--radius);
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.list-item:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.list-item-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary);
}

.list-item-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

.list-item-content {
    flex: 1;
}

.list-item-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.list-item-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Utility */
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 13px; }
.text-lg { font-size: 18px; }
.font-bold { font-weight: 700; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.w-100 { width: 100%; }

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

.fade-in {
    animation: fadeIn 0.3s ease;
}

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

.slide-up {
    animation: slideUp 0.4s ease;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    color: var(--gray-400);
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Result Card */
.result-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 36px;
}

.result-icon.success {
    background: rgba(34, 139, 34, 0.15);
    color: var(--success);
}

.result-icon.error {
    background: rgba(139, 0, 0, 0.15);
    color: var(--danger);
}

/* Responsive */
@media (min-width: 768px) {
    .app-content {
        padding: 32px 20px;
    }
}