/* Reset e configurações gerais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary-color: #ff6b9d;
    --primary-dark: #ff5285;
    --secondary-color: #3498db;
    --secondary-dark: #2980b9;
    --danger-color: #e74c3c;
    --danger-dark: #c0392b;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --gray-color: #95a5a6;
    --white: #ffffff;
    --black: #333333;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--black);
    background-color: #f8f9fa;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: env(safe-area-inset-bottom);
}

/* Container responsivo */
.container {
    width: 100%;
    max-width: 100%;
    padding: 0 16px;
    margin: 0 auto;
}

@media (min-width: 576px) {
    .container {
        max-width: 540px;
        padding: 0;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Header Mobile First */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
    width: 100%;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    flex-wrap: wrap;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo h1::before {
    content: "💅";
    font-size: 1.2em;
}

/* Menu mobile */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

nav {
    display: flex;
    gap: 15px;
    align-items: center;
}

nav a {
    color: var(--white);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: background-color 0.3s;
    white-space: nowrap;
}

nav a:hover, nav a.active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Botões para mobile */
.btn, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    touch-action: manipulation;
    min-height: 48px; /* Tamanho mínimo para toque */
    gap: 8px;
    width: 100%;
    margin: 8px 0;
}

.btn-sm {
    padding: 10px 16px;
    font-size: 0.9rem;
    min-height: 40px;
}

@media (min-width: 768px) {
    .btn, button {
        width: auto;
        margin: 0 4px;
    }
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--secondary-dark);
    transform: translateY(-2px);
}

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

.btn-danger:hover {
    background: var(--danger-dark);
    transform: translateY(-2px);
}

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

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

/* Formulários mobile-friendly */
.auth-form, .form-container {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin: 20px auto;
    max-width: 100%;
}

@media (min-width: 576px) {
    .auth-form, .form-container {
        max-width: 400px;
        padding: 32px;
    }
}

.form-group {
    margin-bottom: 20px;
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: var(--font-family);
    transition: border-color 0.3s, box-shadow 0.3s;
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.2);
}

.form-control:invalid {
    border-color: var(--danger-color);
}

/* Tabelas responsivas */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 20px 0;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Força scroll em telas pequenas */
}

table th, table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

table th {
    background-color: var(--dark-color);
    color: var(--white);
    font-weight: 600;
    position: sticky;
    top: 0;
}

table tbody tr {
    transition: background-color 0.3s;
}

table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    min-width: 80px;
}

.badge-pending {
    background-color: #fff3cd;
    color: #856404;
}

.badge-confirmed {
    background-color: #d4edda;
    color: #155724;
}

.badge-cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

/* Alertas */
.alert {
    padding: 16px;
    border-radius: var(--radius-sm);
    margin: 16px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

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

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Cards para mobile */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    margin: 16px 0;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.card-header {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Grid responsivo */
.grid {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
}

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

@media (min-width: 992px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.grid-4 {
    grid-template-columns: repeat(2, 1fr);
}

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

/* Calendário mobile */
.calendar-container {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    margin: 20px 0;
    box-shadow: var(--shadow);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    color: var(--gray-color);
    padding: 10px 0;
    font-size: 0.9rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9fa;
    touch-action: manipulation;
    min-height: 44px; /* Tamanho mínimo para toque */
}

.calendar-day:hover {
    background: var(--light-color);
}

.calendar-day.available {
    background: #d4edda;
    color: #155724;
}

.calendar-day.selected {
    background: var(--primary-color);
    color: var(--white);
    transform: scale(1.05);
}

.calendar-day.unavailable {
    background: #f8f7da;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Time slots para mobile */
.time-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 20px 0;
}

@media (min-width: 576px) {
    .time-slots {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .time-slots {
        grid-template-columns: repeat(4, 1fr);
    }
}

.time-slot {
    padding: 16px 8px;
    text-align: center;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    background: var(--white);
    touch-action: manipulation;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-slot:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.time-slot.selected {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.time-slot.unavailable {
    background: #f8f7da;
    color: #999;
    cursor: not-allowed;
    border-color: #e0e0e0;
    opacity: 0.6;
}

/* Footer mobile */
footer {
    background: var(--dark-color);
    color: var(--white);
    padding: 30px 0;
    margin-top: 40px;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Modal para mobile */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-color);
}

/* Menu hamburguer para mobile */
@media (max-width: 767px) {
    .menu-toggle {
        display: block;
    }
    
    nav {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: var(--dark-color);
        flex-direction: column;
        padding: 20px;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 999;
        box-shadow: var(--shadow-lg);
    }
    
    nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    nav a {
        width: 100%;
        text-align: center;
        padding: 12px;
        border-radius: var(--radius-sm);
        margin: 4px 0;
    }
    
    .header-content {
        padding: 0 16px;
    }
}

/* Ajustes para iPhone Notch */
@supports (padding: max(0px)) {
    body, header, footer {
        padding-left: min(0px, env(safe-area-inset-left));
        padding-right: min(0px, env(safe-area-inset-right));
    }
    
    .container {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
}

/* Remover zoom em inputs no iOS */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    select:focus,
    textarea:focus,
    input:focus {
        font-size: 16px;
    }
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utilitários */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.flex-column { flex-direction: column; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.w-100 { width: 100%; }
.h-100 { height: 100%; }
.rounded { border-radius: var(--radius); }
.shadow { box-shadow: var(--shadow); }