/**
 * Boxing Day 2026 - Admin Interface Custom Styles
 * Mobile-first responsive design with Christmas theme
 */

/* ===== CSS Variables ===== */
:root {
    /* Christmas Colors */
    --color-christmas-red: #ff3131;
    --color-christmas-red-dark: #cc2727;
    --color-christmas-green: #00bf63;
    --color-christmas-green-dark: #009950;
    
    /* Touch Targets */
    --touch-target-min: 44px;
    --touch-target-preferred: 48px;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
}

/* ===== Base Styles ===== */
* {
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Safe area for notched devices */
.safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom);
}

/* ===== Tab Navigation ===== */
.tab-btn {
    position: relative;
    min-height: var(--touch-target-min);
    color: #6b7280;
    transition: all 0.2s ease;
}

.tab-btn:active {
    transform: scale(0.95);
}

.tab-active {
    color: var(--color-christmas-green);
    font-weight: 600;
}

.tab-active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 3px;
    background: var(--color-christmas-green);
    border-radius: 3px 3px 0 0;
}

/* ===== Buttons ===== */
.btn {
    min-height: var(--touch-target-preferred);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
}

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

.btn-primary {
    background: var(--color-christmas-green);
    color: white;
}

.btn-primary:hover {
    background: var(--color-christmas-green-dark);
}

.btn-primary:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-danger {
    background: var(--color-christmas-red);
    color: white;
}

.btn-danger:hover {
    background: var(--color-christmas-red-dark);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-icon {
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
    padding: 0.5rem;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Score adjustment buttons */
.btn-score {
    min-width: 48px;
    min-height: 48px;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    color: white;
    transition: all 0.2s ease;
}

.btn-score.positive {
    background: var(--color-christmas-green);
}

.btn-score.positive:hover {
    background: var(--color-christmas-green-dark);
}

.btn-score.negative {
    background: var(--color-christmas-red);
}

.btn-score.negative:hover {
    background: var(--color-christmas-red-dark);
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 88px;
    right: 1rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--color-christmas-green);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-lg);
    transition: all 0.2s ease;
    z-index: 40;
}

.fab:hover {
    background: var(--color-christmas-green-dark);
    transform: scale(1.05);
}

.fab:active {
    transform: scale(0.95);
}

/* ===== Cards ===== */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

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

.card-active {
    border: 2px solid var(--color-christmas-green);
    box-shadow: 0 4px 12px rgba(0, 191, 99, 0.2);
}

/* ===== Forms ===== */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
textarea,
select {
    min-height: var(--touch-target-preferred);
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.2s ease;
    width: 100%;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-christmas-green);
    ring: 2px;
    ring-color: var(--color-christmas-green);
    ring-opacity: 0.5;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* JSON Editor Textarea */
textarea.font-mono {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    line-height: 1.5;
    tab-size: 2;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
}

label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* ===== Modal ===== */
.modal-enter {
    opacity: 0;
    transform: scale(0.95);
}

.modal-enter-active {
    opacity: 1;
    transform: scale(1);
    transition: all 0.2s ease-out;
}

.modal-exit {
    opacity: 1;
    transform: scale(1);
}

.modal-exit-active {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.2s ease-in;
}

/* Bottom sheet for mobile */
@media (max-width: 640px) {
    #modal-content {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 1rem 1rem 0 0;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-enter {
        transform: translateY(100%);
    }
    
    .modal-enter-active {
        transform: translateY(0);
    }
    
    .modal-exit-active {
        transform: translateY(100%);
    }
}

/* ===== Toast Notifications ===== */
.toast {
    background: #1f2937;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 280px;
    max-width: 100%;
    pointer-events: auto;
    animation: slideInDown 0.3s ease-out;
}

.toast-success {
    background: var(--color-christmas-green);
}

.toast-error {
    background: var(--color-christmas-red);
}

.toast-info {
    background: #3b82f6;
}

.toast-warning {
    background: #f59e0b;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOutUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-100%);
    }
}

.toast-exit {
    animation: slideOutUp 0.3s ease-in;
}

/* ===== Loading Spinner ===== */
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f4f6;
    border-top-color: var(--color-christmas-green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

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

.spinner-sm {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

/* ===== Avatar ===== */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    background: var(--color-christmas-green);
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 1.25rem;
}

/* ===== Badge ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-error {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* ===== Divider ===== */
.divider {
    height: 1px;
    background: #e5e7eb;
    margin: 1rem 0;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.empty-state-description {
    color: #6b7280;
}

/* ===== List Items ===== */
.list-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: var(--radius-lg);
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.list-item:active {
    transform: scale(0.98);
    background: #f9fafb;
}

/* ===== Animations ===== */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

/* ===== Utility Classes ===== */
.touch-target {
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* ===== Responsive Adjustments ===== */
@media (min-width: 768px) {
    .fab {
        bottom: 1rem;
    }
    
    #app {
        padding-bottom: 0;
    }
    
    nav {
        position: relative;
    }
}

/* ===== Focus Visible ===== */
*:focus-visible {
    outline: 2px solid var(--color-christmas-green);
    outline-offset: 2px;
}

/* ===== Print Styles ===== */
@media print {
    .no-print,
    nav,
    header button,
    .fab {
        display: none !important;
    }
}