/**
 * RSVisindo Plugin Styles
 * Main stylesheet for frontend
 */

/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* Base styles */
.rsvisindo-container {
    font-family: 'Inter', sans-serif;
}

/* Loading states */
.rsvisindo-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.rsvisindo-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

/* Spinner animation */
.rsvisindo-spinner {
    border: 2px solid #f3f3f3;
    border-radius: 50%;
    border-top: 2px solid #E94B5B;
    width: 20px;
    height: 20px;
    animation: rsvisindo-spin 1s linear infinite;
}

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

/* Button styles */
.rsvisindo-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.rsvisindo-btn:focus {
    box-shadow: 0 0 0 3px rgba(233, 75, 91, 0.3);
}

.rsvisindo-btn-primary {
    background-color: #E94B5B;
    color: white;
}

.rsvisindo-btn-primary:hover:not(:disabled) {
    background-color: #d43e4a;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(233, 75, 91, 0.3);
}

.rsvisindo-btn-secondary {
    background-color: white;
    color: #E94B5B;
    border: 1px solid #E94B5B;
}

.rsvisindo-btn-secondary:hover:not(:disabled) {
    background-color: #E94B5B;
    color: white;
}

.rsvisindo-btn:disabled {
    background-color: #9CA3AF;
    color: white;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.rsvisindo-btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.rsvisindo-btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

/* Form styles */
.rsvisindo-form-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.rsvisindo-form-label {
    font-size: 14px;
    color: #4B4B4B;
    margin-bottom: 6px;
    font-weight: 500;
}

.rsvisindo-form-label.required::after {
    content: '*';
    color: #E94B5B;
    margin-left: 4px;
}

.rsvisindo-form-input,
.rsvisindo-form-select,
.rsvisindo-form-textarea {
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 15px;
    transition: all 0.2s ease;
    background-color: white;
    font-family: inherit;
}

.rsvisindo-form-input::placeholder,
.rsvisindo-form-textarea::placeholder {
    color: #9CA3AF;
}

.rsvisindo-form-input:focus,
.rsvisindo-form-select:focus,
.rsvisindo-form-textarea:focus {
    outline: none;
    border-color: #E94B5B;
    box-shadow: 0 0 0 3px rgba(233, 75, 91, 0.1);
}

.rsvisindo-form-input.error,
.rsvisindo-form-select.error,
.rsvisindo-form-textarea.error {
    border-color: #EF4444;
}

.rsvisindo-form-error {
    color: #EF4444;
    font-size: 12px;
    margin-top: 4px;
}

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

/* Card styles */
.rsvisindo-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: all 0.2s ease;
}

.rsvisindo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.rsvisindo-card-header {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #E5E7EB;
}

.rsvisindo-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #2B4A7B;
    margin: 0;
}

.rsvisindo-card-body {
    margin-bottom: 16px;
}

.rsvisindo-card-footer {
    padding-top: 16px;
    border-top: 1px solid #E5E7EB;
}

/* Doctor card specific styles */
.rsvisindo-doctor-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rsvisindo-doctor-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.rsvisindo-doctor-photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.rsvisindo-doctor-photo-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    flex-shrink: 0;
}

.rsvisindo-doctor-info {
    flex: 1;
}

.rsvisindo-doctor-name {
    color: #2B4A7B;
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    margin-bottom: 4px;
    display: block;
}

.rsvisindo-doctor-name:hover {
    color: #1e3a66;
}

.rsvisindo-doctor-specialty {
    font-size: 12px;
    color: #4B4B4B;
    font-weight: normal;
    margin-bottom: 4px;
}

.rsvisindo-doctor-hospital {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #9CA3AF;
}

.rsvisindo-hospital-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* Schedule styles */
.rsvisindo-schedule-container {
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    padding: 12px;
}

.rsvisindo-schedule-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.rsvisindo-schedule-item:last-child {
    margin-bottom: 0;
}

.rsvisindo-schedule-day {
    color: #E94B5B;
    font-weight: 600;
    font-size: 13px;
}

.rsvisindo-schedule-time {
    background-color: #F9F0D9;
    color: #BFAF7D;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    text-align: center;
}

/* Calendar styles */
.rsvisindo-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 24px;
}

.rsvisindo-calendar-header {
    text-align: center;
    font-weight: 600;
    color: #4B4B4B;
    padding: 12px;
    font-size: 14px;
}

.rsvisindo-calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.rsvisindo-calendar-day.available {
    background-color: white;
    border-color: #D1D5DB;
    color: #4B4B4B;
}

.rsvisindo-calendar-day.available:hover {
    border-color: #E94B5B;
    background-color: #FEF2F2;
}

.rsvisindo-calendar-day.selected {
    background-color: #E94B5B;
    color: white;
    border-color: #E94B5B;
}

.rsvisindo-calendar-day.unavailable {
    background-color: #F3F4F6;
    color: #9CA3AF;
    cursor: not-allowed;
    border-color: #E5E7EB;
}

.rsvisindo-calendar-day.other-month {
    color: #D1D5DB;
    background-color: #F9FAFB;
    cursor: not-allowed;
}

/* Time slots styles */
.rsvisindo-time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.rsvisindo-time-slot {
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rsvisindo-time-slot-time {
    font-size: 16px;
    font-weight: 600;
    color: #2B4A7B;
    margin-bottom: 4px;
}

.rsvisindo-time-slot-status {
    font-size: 12px;
    color: #10B981;
    font-weight: 500;
}

.rsvisindo-time-slot:hover {
    border-color: #E94B5B;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233, 75, 91, 0.15);
}

.rsvisindo-time-slot.selected {
    background-color: #E94B5B;
    border-color: #E94B5B;
}

.rsvisindo-time-slot.selected .rsvisindo-time-slot-time,
.rsvisindo-time-slot.selected .rsvisindo-time-slot-status {
    color: white;
}

.rsvisindo-time-slot.unavailable {
    background-color: #F3F4F6;
    border-color: #E5E7EB;
    cursor: not-allowed;
}

.rsvisindo-time-slot.unavailable .rsvisindo-time-slot-time {
    color: #9CA3AF;
}

.rsvisindo-time-slot.unavailable .rsvisindo-time-slot-status {
    color: #EF4444;
}

.rsvisindo-time-slot.unavailable:hover {
    transform: none;
    box-shadow: none;
    border-color: #E5E7EB;
}

/* Messages */
.rsvisindo-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.rsvisindo-message-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #DC2626;
}

.rsvisindo-message-success {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    color: #16A34A;
}

.rsvisindo-message-warning {
    background: #FFFBEB;
    border: 1px solid #FED7AA;
    color: #D97706;
}

.rsvisindo-message-info {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    color: #2563EB;
}

/* Grid utilities */
.rsvisindo-grid {
    display: grid;
    gap: 24px;
}

.rsvisindo-grid-1 {
    grid-template-columns: 1fr;
}

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

.rsvisindo-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

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

/* Responsive */
@media (max-width: 768px) {
    .rsvisindo-grid-2,
    .rsvisindo-grid-3 {
        grid-template-columns: 1fr;
    }
    
    .rsvisindo-doctor-header {
        flex-direction: column;
        text-align: center;
    }
    
    .rsvisindo-calendar-grid {
        gap: 4px;
    }
    
    .rsvisindo-calendar-day {
        font-size: 12px;
        padding: 8px;
    }
    
    .rsvisindo-time-slots-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 8px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .rsvisindo-card,
    .rsvisindo-btn,
    .rsvisindo-time-slot,
    .rsvisindo-calendar-day {
        transition: none;
    }
}

/* Print styles */
@media print {
    .rsvisindo-btn,
    .rsvisindo-calendar-navigation {
        display: none;
    }
    
    .rsvisindo-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .rsvisindo-btn-primary {
        background-color: #000;
        border: 2px solid #000;
    }
    
    .rsvisindo-btn-secondary {
        border: 2px solid #000;
        color: #000;
    }
    
    .rsvisindo-form-input,
    .rsvisindo-form-select,
    .rsvisindo-form-textarea {
        border: 2px solid #000;
    }
}

/* Focus styles for keyboard navigation */
.rsvisindo-btn:focus-visible,
.rsvisindo-form-input:focus-visible,
.rsvisindo-form-select:focus-visible,
.rsvisindo-form-textarea:focus-visible,
.rsvisindo-calendar-day:focus-visible,
.rsvisindo-time-slot:focus-visible {
    outline: 2px solid #E94B5B;
    outline-offset: 2px;
}

/* Utility classes */
.rsvisindo-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.rsvisindo-text-center {
    text-align: center;
}

.rsvisindo-text-left {
    text-align: left;
}

.rsvisindo-text-right {
    text-align: right;
}

.rsvisindo-mb-4 {
    margin-bottom: 16px;
}

.rsvisindo-mb-6 {
    margin-bottom: 24px;
}

.rsvisindo-mt-4 {
    margin-top: 16px;
}

.rsvisindo-mt-6 {
    margin-top: 24px;
}