/* Healthcare Appointment System - Custom Styles */

/* Base Styles for Elderly-Friendly Interface */
:root {
    --primary-color: #0369a1;
    --secondary-color: #0f766e;
    --success-color: #059669;
    --info-color: #0891b2;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-color: #f0f9ff;
    --dark-color: #0f172a;
    --gray-100: #f8fafc;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-500: #64748b;
    --gray-700: #334155;
    --border-radius: 12px;
    --shadow: 0 2px 8px rgba(3, 105, 161, 0.1), 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 8px 24px rgba(3, 105, 161, 0.18), 0 4px 8px rgba(0, 0, 0, 0.08);
    --gradient-primary: linear-gradient(135deg, #0369a1 0%, #0284c7 100%);
    --gradient-success: linear-gradient(135deg, #059669 0%, #0d9488 100%);
    --gradient-light: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #ecfeff 100%);
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-700);
    background: var(--gradient-light);
    min-height: 100vh;
}

/* Elderly-Friendly Button Styles */
.btn-elderly {
    font-size: 1.2rem;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    border: none;
    text-transform: none;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    min-width: 120px;
    box-shadow: var(--shadow);
}

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

.btn-elderly.btn-lg {
    font-size: 1.4rem;
    padding: 16px 32px;
    min-width: 160px;
}

.btn-primary.btn-elderly {
    background: var(--gradient-primary);
}

.btn-success.btn-elderly {
    background: var(--gradient-success);
}

.btn-info.btn-elderly {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

/* Form Controls */
.form-control, .form-select {
    font-size: 1.1rem;
    padding: 12px 16px;
    border-radius: var(--border-radius);
    border: 2px solid #ddd;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

.form-control-lg {
    font-size: 1.2rem;
    padding: 16px 20px;
}

.form-label {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 8px;
}

.form-label.required::after {
    content: " *";
    color: var(--danger-color);
    font-weight: bold;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #f0fdfa 0%, #ecfeff 50%, #f0f9ff 100%);
    color: var(--gray-700);
    padding: 80px 0;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 70%, rgba(14, 165, 233, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(16, 185, 129, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.hero-section .display-4 {
    font-weight: 700;
    color: var(--dark-color);
    position: relative;
    z-index: 2;
}

.hero-section .lead {
    font-size: 1.2rem;
    color: var(--gray-500);
    position: relative;
    z-index: 2;
}

/* Action Cards */
.action-card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    background: white;
    border: 1px solid var(--gray-200);
}

.action-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.action-card .card-body {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

/* How It Works Section */
.how-it-works {
    background: white;
    padding: 60px 0;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.step-circle {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 20px;
    box-shadow: var(--shadow);
}

/* Admin Access */
.admin-access {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #dee2e6;
}

/* Patient Wizard Styles */
.patient-wizard {
    background: var(--gradient-light);
    min-height: 100vh;
    padding: 40px 0;
    position: relative;
}

.patient-wizard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(14, 165, 233, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.progress-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px 10px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
    position: relative;
    overflow-x: auto;
}

.progress-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 20%;
    right: 20%;
    height: 3px;
    background: #ddd;
    z-index: 1;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    background: white;
    padding: 5px;
    min-width: 60px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.progress-step:hover {
    transform: scale(1.05);
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ddd;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 6px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
}

.progress-step.active .step-number {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.progress-step.active .step-label {
    color: var(--primary-color);
}

.progress-step.completed .step-number {
    background: var(--success-color);
    color: white;
}

.progress-step.completed .step-label {
    color: var(--success-color);
}

/* Wizard Card */
.wizard-card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-hover);
    overflow: hidden;
}

.wizard-header {
    background: var(--gradient-primary);
    color: white;
    padding: 40px;
    text-align: center;
}

.wizard-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.wizard-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin: 0;
}

.wizard-body {
    padding: 40px;
}

.wizard-footer {
    background: #f8f9fa;
    padding: 30px 40px;
    text-align: center;
    border-top: 1px solid #dee2e6;
}

/* Option Cards */
.option-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

.option-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.option-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.option-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.option-subtitle {
    color: #666;
    margin-bottom: 20px;
    font-size: 1rem;
}

.option-action {
    margin-top: auto;
}

/* Time Slots */
.time-slots {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 10px;
}

.time-slots::-webkit-scrollbar {
    width: 8px;
}

.time-slots::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.time-slots::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.date-section {
    margin-bottom: 30px;
}

.date-header {
    background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
    color: var(--primary-color);
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: 600;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-color);
}

.time-slot-btn {
    display: block;
    background: white;
    color: var(--primary-color);
    text-decoration: none;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 15px;
    font-weight: 600;
    font-size: 1.1rem;
    text-align: center;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.time-slot-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    text-decoration: none;
}

/* Summary Card */
.summary-card {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 2px solid var(--success-color);
    border-radius: 12px;
    padding: 25px;
}

.summary-title {
    color: var(--success-color);
    font-weight: 600;
    margin-bottom: 20px;
}

.summary-content {
    color: #065f46;
}

.summary-item {
    margin-bottom: 15px;
}

.summary-item strong {
    display: block;
    margin-bottom: 5px;
    color: #0e7490;
}

/* Form Actions */
.form-actions {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid #dee2e6;
}

/* Success Page */
.success-page {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    min-height: 100vh;
    padding: 60px 0;
}

.success-card {
    background: white;
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: var(--shadow-hover);
}

.success-icon {
    font-size: 6rem;
    color: var(--success-color);
    margin-bottom: 30px;
}

.success-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--success-color);
    margin-bottom: 15px;
}

.success-subtitle {
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 40px;
}

.appointment-details {
    margin: 40px 0;
}

.detail-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 30px;
    text-align: left;
}

.detail-title {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 25px;
    text-align: center;
}

.detail-item {
    margin-bottom: 20px;
}

.detail-label {
    font-weight: 600;
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.detail-value {
    font-size: 1.1rem;
    color: #333;
    font-weight: 500;
}

.patient-info {
    border-top: 1px solid #dee2e6;
    padding-top: 20px;
}

.important-info {
    margin: 30px 0;
}

/* Alert Persistente - não desaparece automaticamente */
.alert-persistent {
    border: 2px solid var(--info-color) !important;
    box-shadow: 0 4px 8px rgba(6, 182, 212, 0.2) !important;
    background-color: #cffafe !important;
    animation: pulse-info 2s infinite;
}

.alert-persistent strong {
    color: var(--danger-color) !important;
    font-size: 1.1em !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.alert-persistent .btn {
    margin: 2px;
}

/* Animação para destacar a mensagem */
@keyframes pulse-info {
    0% {
        box-shadow: 0 4px 8px rgba(6, 182, 212, 0.2);
    }
    50% {
        box-shadow: 0 6px 12px rgba(6, 182, 212, 0.4);
    }
    100% {
        box-shadow: 0 4px 8px rgba(6, 182, 212, 0.2);
    }
}

/* Mobile Responsiveness para Progress */
@media (max-width: 768px) {
    .progress-container {
        padding: 10px 5px;
    }
    
    .progress-step {
        padding: 3px;
        min-width: 50px;
    }
    
    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .step-label {
        font-size: 0.65rem;
    }
    
    .progress-container::before {
        left: 15%;
        right: 15%;
    }
}

.success-actions {
    margin-top: 40px;
}

.success-actions .btn {
    margin: 0 10px 10px;
}

/* Admin Styles */
.navbar-dark .navbar-brand {
    font-weight: 600;
    font-size: 1.3rem;
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
    border: none;
}

.table {
    font-size: 0.95rem;
}

.table th {
    background: #f8f9fa;
    border-top: none;
    font-weight: 600;
    color: #495057;
}

.btn-sm {
    font-size: 0.8rem;
    padding: 6px 12px;
    margin: 2px;
}

/* Modal Styles */
.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    border-radius: 12px 12px 0 0;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 12px 12px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-section .display-4 {
        font-size: 2.5rem;
    }
    
    .wizard-title {
        font-size: 1.8rem;
    }
    
    .wizard-subtitle {
        font-size: 1.1rem;
    }
    
    .wizard-header,
    .wizard-body,
    .wizard-footer {
        padding: 30px 20px;
    }
    
    .progress-container {
        padding: 15px;
    }
    
    .step-label {
        font-size: 0.8rem;
    }
    
    .option-card {
        margin-bottom: 20px;
    }
    
    .success-icon {
        font-size: 4rem;
    }
    
    .success-title {
        font-size: 2rem;
    }
    
    .success-card {
        padding: 40px 20px;
    }
    
    .btn-elderly.btn-lg {
        font-size: 1.2rem;
        padding: 14px 24px;
    }
}

@media (max-width: 576px) {
    .progress-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .progress-container::before {
        display: none;
    }
    
    .time-slot-btn {
        margin-bottom: 15px;
    }
    
    .detail-card {
        padding: 20px;
    }
    
    .wizard-body {
        padding: 20px 15px;
    }
}

/* Accessibility Improvements */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast for better visibility */
.text-muted {
    color: #666 !important;
}

/* Loading and hover states */
.btn-elderly:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-elderly:active {
    transform: translateY(0);
}

/* Announcements Section */
.announcements-section {
    background: white;
    padding: 40px 0;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.announcements-section h2 {
    color: var(--dark-color);
    font-weight: 700;
}

.announcement-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
}

.announcement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.announcement-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    overflow: hidden;
    background: var(--gray-200);
}

.announcement-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.announcement-title {
    color: var(--dark-color);
    font-weight: 600;
    line-height: 1.3;
}

.announcement-description {
    color: var(--gray-700);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .announcements-section {
        padding: 30px 15px;
    }
    
    .announcements-section h2 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    .announcement-card {
        margin-bottom: 1.5rem;
    }
    
    .announcement-card .card-body {
        padding: 1.5rem;
    }
    
    .announcement-title {
        font-size: 1.3rem;
    }
    
    .announcement-description {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .announcements-section {
        padding: 20px 10px;
    }
    
    .announcements-section h2 {
        font-size: 1.5rem;
    }
    
    .announcement-card .card-body {
        padding: 1.2rem;
    }
    
    .announcement-title {
        font-size: 1.2rem;
    }
    
    .announcement-description {
        font-size: 0.95rem;
    }
}

/* Print styles */
@media print {
    /* Ocultar elementos desnecessários na impressão */
    .btn, .navbar, .wizard-footer, .success-actions, .hero-section {
        display: none !important;
    }
    
    /* Resetar estilos para impressão */
    * {
        box-shadow: none !important;
    }
    
    body {
        background: white !important;
        margin: 0;
        padding: 0;
    }
    
    .success-page {
        background: white !important;
        padding: 0 !important;
        min-height: auto !important;
    }
    
    .container {
        max-width: 100% !important;
        padding: 10px !important;
        margin: 0 !important;
    }
    
    .success-card {
        padding: 15px !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        page-break-inside: avoid;
    }
    
    .success-icon {
        font-size: 3rem !important;
        margin-bottom: 10px !important;
    }
    
    .success-title {
        font-size: 1.8rem !important;
        margin-bottom: 8px !important;
    }
    
    .success-subtitle {
        font-size: 1rem !important;
        margin-bottom: 15px !important;
    }
    
    .appointment-details {
        margin: 15px 0 !important;
    }
    
    .detail-card {
        padding: 15px !important;
        border: 1px solid #333 !important;
        border-radius: 0 !important;
        page-break-inside: avoid;
    }
    
    .detail-title {
        font-size: 1.1rem !important;
        margin-bottom: 12px !important;
    }
    
    .detail-item {
        margin-bottom: 8px !important;
    }
    
    .detail-label {
        font-size: 0.85rem !important;
        margin-bottom: 2px !important;
    }
    
    .detail-value {
        font-size: 0.95rem !important;
    }
    
    .patient-info {
        padding-top: 10px !important;
        margin-top: 10px !important;
    }
    
    .important-info {
        margin: 15px 0 !important;
    }
    
    .alert {
        padding: 12px !important;
        font-size: 0.85rem !important;
        border: 1px solid #333 !important;
        background-color: #f8f9fa !important;
        page-break-inside: avoid;
    }
    
    .alert-heading {
        font-size: 0.95rem !important;
        margin-bottom: 8px !important;
    }
    
    .alert ul {
        margin-bottom: 0 !important;
        padding-left: 20px !important;
    }
    
    .alert li {
        margin-bottom: 4px !important;
        font-size: 0.85rem !important;
    }
    
    /* Forçar tudo em uma única página */
    .success-page, .success-card, .detail-card, .alert {
        page-break-inside: avoid;
    }
    
    /* Ajustar espaçamento das colunas */
    .row.g-4 {
        gap: 8px !important;
    }
    
    .col-md-6 {
        padding: 0 5px !important;
    }
    
    /* Remover ícones que ocupam espaço */
    .fas, .far, .fab {
        display: none !important;
    }
    
    .card, .wizard-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .announcement-card {
        page-break-inside: avoid;
    }
}
