/*
 * The Curl Collective - Modern Design System
 * Preserving the original spa-like color palette with modern enhancements
 */

/* ============================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */

:root {
    /* Original Color Palette */
    --color-cream: #F6F4EF;
    --color-linen: #E6DFD5;
    --color-taupe: #CFC6BB;
    --color-sage: #9CAF9A;
    --color-eucalyptus: #7E9886;
    --color-olive: #4F5E52;
    --color-clay: #C28E6A;
    --color-text: #3E3A36;
    --color-text-light: #6F6A63;

    /* Enhanced Color Variations */
    --color-olive-light: #6B7C6E;
    --color-olive-dark: #3D4A40;
    --color-sage-light: #B4C4B2;
    --color-eucalyptus-dark: #68826F;
    --color-clay-light: #D4A585;
    --color-cream-dark: #EBE8E0;

    /* Semantic Colors */
    --color-success: var(--color-sage);
    --color-error: var(--color-clay);
    --color-warning: #D4A574;
    --color-info: var(--color-eucalyptus);

    /* Typography */
    --font-heading: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Cormorant Garamond', Georgia, serif;
    --font-meta: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

    /* Font Sizes (Fluid Typography) */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.825rem + 0.25vw, 1rem);
    --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1.05rem + 0.375vw, 1.375rem);
    --text-xl: clamp(1.25rem, 1.15rem + 0.5vw, 1.625rem);
    --text-2xl: clamp(1.5rem, 1.35rem + 0.75vw, 2rem);
    --text-3xl: clamp(1.875rem, 1.65rem + 1.125vw, 2.625rem);
    --text-4xl: clamp(2.25rem, 1.95rem + 1.5vw, 3.25rem);

    /* Spacing Scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Shadows (Modern, Layered) */
    --shadow-sm: 0 1px 2px rgba(62, 58, 54, 0.06), 0 1px 3px rgba(62, 58, 54, 0.1);
    --shadow-md: 0 4px 6px rgba(62, 58, 54, 0.07), 0 2px 4px rgba(62, 58, 54, 0.06);
    --shadow-lg: 0 10px 15px rgba(62, 58, 54, 0.1), 0 4px 6px rgba(62, 58, 54, 0.05);
    --shadow-xl: 0 20px 25px rgba(62, 58, 54, 0.1), 0 10px 10px rgba(62, 58, 54, 0.04);
    --shadow-inner: inset 0 2px 4px rgba(62, 58, 54, 0.06);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* ============================================
   MODERN CSS RESET
   ============================================ */

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-cream);
    min-height: 100vh;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

input, button, textarea, select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 400;
    line-height: 1.2;
    color: var(--color-text);
    margin-bottom: var(--space-md);
}

h1 { font-size: var(--text-4xl); letter-spacing: -0.02em; }
h2 { font-size: var(--text-3xl); letter-spacing: -0.01em; }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); font-weight: 500; }

p {
    margin-bottom: var(--space-md);
    max-width: 65ch;
}

.text-meta {
    font-family: var(--font-meta);
    font-size: var(--text-sm);
    letter-spacing: 0.01em;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-light); }

/* ============================================
   LAYOUT COMPONENTS
   ============================================ */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-sm {
    max-width: 600px;
}

.container-md {
    max-width: 900px;
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--space-2xl) var(--space-lg);
}

/* Card Component */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

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

.card-header {
    padding-bottom: var(--space-lg);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--color-taupe);
}

.card-body {
    padding: var(--space-lg) 0;
}

.card-footer {
    padding-top: var(--space-lg);
    margin-top: var(--space-lg);
    border-top: 1px solid var(--color-taupe);
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   BUTTON COMPONENTS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-family: var(--font-meta);
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    transition: all var(--transition-base);
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}

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

/* Primary Button */
.btn-primary {
    background: var(--color-olive);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-olive-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Secondary Button */
.btn-secondary {
    background: var(--color-sage);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--color-eucalyptus);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Outline Button */
.btn-outline {
    background: transparent;
    color: var(--color-olive);
    border-color: var(--color-olive);
}

.btn-outline:hover:not(:disabled) {
    background: var(--color-olive);
    color: white;
    transform: translateY(-2px);
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: var(--color-olive);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--color-linen);
}

/* Danger Button */
.btn-danger {
    background: var(--color-clay);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #B07A56;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Button Sizes */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: var(--text-xs);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: var(--text-base);
}

.btn-full {
    width: 100%;
}

/* Button Group */
.btn-group {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.btn-group-center {
    justify-content: center;
}

/* ============================================
   FORM COMPONENTS
   ============================================ */

.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-family: var(--font-meta);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: var(--text-base);
    color: var(--color-text);
    background: white;
    border: 2px solid var(--color-taupe);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--color-sage);
    box-shadow: 0 0 0 3px rgba(156, 175, 154, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-light);
    opacity: 0.6;
}

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

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234F5E52' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-error {
    font-family: var(--font-meta);
    font-size: var(--text-sm);
    color: var(--color-clay);
    margin-top: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.form-help {
    font-family: var(--font-meta);
    font-size: var(--text-sm);
    color: var(--color-text-light);
    margin-top: var(--space-sm);
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: var(--color-olive);
}

/* ============================================
   ALERT COMPONENTS
   ============================================ */

.alert {
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    border-left: 4px solid;
    margin-bottom: var(--space-lg);
    animation: slideIn var(--transition-base);
}

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

.alert-success {
    background: rgba(156, 175, 154, 0.1);
    border-color: var(--color-sage);
    color: var(--color-eucalyptus-dark);
}

.alert-error {
    background: rgba(194, 142, 106, 0.1);
    border-color: var(--color-clay);
    color: #9B6B4F;
}

.alert-warning {
    background: rgba(212, 165, 116, 0.1);
    border-color: var(--color-warning);
    color: #A0824E;
}

.alert-info {
    background: rgba(126, 152, 134, 0.1);
    border-color: var(--color-eucalyptus);
    color: var(--color-eucalyptus-dark);
}

/* ============================================
   BADGE COMPONENTS
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.75rem;
    font-family: var(--font-meta);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-confirmed {
    background: rgba(156, 175, 154, 0.15);
    color: var(--color-eucalyptus-dark);
}

.badge-pending {
    background: rgba(212, 165, 116, 0.15);
    color: #A0824E;
}

.badge-cancelled {
    background: rgba(194, 142, 106, 0.15);
    color: #9B6B4F;
}

.badge-completed {
    background: rgba(126, 152, 134, 0.15);
    color: var(--color-eucalyptus-dark);
}

/* ============================================
   TABLE COMPONENTS
   ============================================ */

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table th,
.table td {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    border-bottom: 1px solid var(--color-linen);
}

.table th {
    font-family: var(--font-meta);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-text-light);
    background: var(--color-cream);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--color-cream);
}

/* ============================================
   LOADING & SKELETON STATES
   ============================================ */

.loading {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--color-linen);
    border-top-color: var(--color-olive);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-linen) 25%,
        var(--color-cream) 50%,
        var(--color-linen) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   NAVIGATION COMPONENTS
   ============================================ */

.nav {
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

.nav-link {
    font-family: var(--font-meta);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    background: var(--color-linen);
    color: var(--color-olive);
}

.nav-link.active {
    background: var(--color-olive);
    color: white;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Spacing */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mt-4 { margin-top: var(--space-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.mb-4 { margin-bottom: var(--space-xl); }

.p-0 { padding: 0; }
.p-1 { padding: var(--space-sm); }
.p-2 { padding: var(--space-md); }
.p-3 { padding: var(--space-lg); }
.p-4 { padding: var(--space-xl); }

/* Display */
.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* Flexbox */
.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-column {
    flex-direction: column;
}

.gap-1 { gap: var(--space-sm); }
.gap-2 { gap: var(--space-md); }
.gap-3 { gap: var(--space-lg); }
.gap-4 { gap: var(--space-xl); }

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

@media (max-width: 768px) {
    .hide-mobile { display: none !important; }

    .card {
        padding: var(--space-lg);
    }

    .page-wrapper {
        padding: var(--space-lg) var(--space-md);
    }
}

@media (min-width: 769px) {
    .hide-desktop { display: none !important; }
}

/* ============================================
   CUSTOM COMPONENTS
   ============================================ */

/* Logo / Branding */
.logo {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--color-olive);
    text-align: center;
    margin-bottom: var(--space-lg);
}

/* Time Slot Grid */
.time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.time-slot {
    padding: var(--space-md);
    text-align: center;
    background: white;
    border: 2px solid var(--color-taupe);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: var(--font-meta);
    font-size: var(--text-sm);
    font-weight: 500;
}

.time-slot:hover:not(:disabled) {
    border-color: var(--color-sage);
    background: var(--color-linen);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.time-slot.selected {
    background: var(--color-sage);
    border-color: var(--color-sage);
    color: white;
    box-shadow: var(--shadow-md);
}

.time-slot:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--color-cream);
}

/* Stats Card */
.stat-card {
    background: white;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: all var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.stat-value {
    font-family: var(--font-heading);
    font-size: var(--text-4xl);
    color: var(--color-olive);
    font-weight: 300;
    line-height: 1;
    margin-bottom: var(--space-sm);
}

.stat-label {
    font-family: var(--font-meta);
    font-size: var(--text-sm);
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Stylist Card */
.stylist-card {
    background: white;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    text-align: center;
}

.stylist-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.stylist-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto var(--space-lg);
    background: var(--color-linen);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: var(--text-3xl);
    color: var(--color-olive);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

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

.stylist-name {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

.stylist-bio {
    color: var(--color-text-light);
    margin-bottom: var(--space-lg);
    font-size: var(--text-sm);
}

/* Appointment List */
.appointment-item {
    background: white;
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-sage);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-md);
    transition: all var(--transition-base);
}

.appointment-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-4xl) var(--space-xl);
    color: var(--color-text-light);
}

.empty-state-icon {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-lg);
    opacity: 0.5;
}

/* Divider */
.divider {
    height: 1px;
    background: var(--color-taupe);
    margin: var(--space-xl) 0;
    border: none;
}

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