/* Frontend Styles for Terminscheduler */

.terminscheduler-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.terminscheduler-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.terminscheduler-form-row {
    margin-bottom: 20px;
}

.terminscheduler-form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 600px) {
    .terminscheduler-form-row-2col {
        grid-template-columns: 1fr;
    }
}

.terminscheduler-form-group {
    display: flex;
    flex-direction: column;
}


.terminscheduler-form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.terminscheduler-input {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: #fff;
}

.terminscheduler-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.terminscheduler-input.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 1px #dc3545;
}

textarea.terminscheduler-input {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.terminscheduler-checkbox-group {
    flex-direction: row;
    align-items: flex-start;
}

.terminscheduler-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
    line-height: 1.5;
}

.terminscheduler-checkbox {
    margin-right: 10px;
    margin-top: 2px;
    flex-shrink: 0;
}

.terminscheduler-checkbox-text {
    font-size: 14px;
    color: #555;
}

.terminscheduler-checkbox-text a {
    color: #0073aa;
    text-decoration: none;
}

.terminscheduler-checkbox-text a:hover {
    text-decoration: underline;
}

.required {
    color: #dc3545;
    font-weight: bold;
}

.terminscheduler-submit-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
}

.terminscheduler-submit-btn:hover {
    background-color: #005a87;
}

.terminscheduler-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.terminscheduler-submit-btn.loading {
    position: relative;
    color: transparent;
}

.terminscheduler-submit-btn.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: terminscheduler-spin 1s ease-in-out infinite;
}

@keyframes terminscheduler-spin {
    to { transform: rotate(360deg); }
}

.terminscheduler-error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

.terminscheduler-error.show {
    display: block;
}

.terminscheduler-success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin-top: 20px;
    font-size: 16px;
    line-height: 1.5;
}

.terminscheduler-general-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-top: 20px;
    font-size: 16px;
    line-height: 1.5;
}

/* Flatpickr overrides when loaded */
.flatpickr-calendar {
    font-family: inherit;
}

.flatpickr-day.selected {
    background: #0073aa;
    border-color: #0073aa;
}

.flatpickr-day.selected:hover {
    background: #005a87;
    border-color: #005a87;
}

/* RTL Support */
.rtl .terminscheduler-checkbox {
    margin-right: 0;
    margin-left: 10px;
}

.rtl .terminscheduler-checkbox-label {
    direction: rtl;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .terminscheduler-form {
        border-color: #000;
    }
    
    .terminscheduler-input {
        border-color: #000;
    }
    
    .terminscheduler-submit-btn {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .terminscheduler-input,
    .terminscheduler-submit-btn {
        transition: none;
    }
    
    .terminscheduler-submit-btn.loading::after {
        animation: none;
    }
}

/* Cancellation Status Styles */
.terminscheduler-cancellation-success,
.terminscheduler-cancellation-error,
.terminscheduler-cancellation-info {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.terminscheduler-cancellation-success {
    background: #f0f9f0;
    border: 1px solid #4caf50;
    color: #2e7d2e;
}

.terminscheduler-cancellation-success h2 {
    color: #2e7d2e;
    margin-bottom: 20px;
}

.terminscheduler-cancellation-error {
    background: #fdf2f2;
    border: 1px solid #f44336;
    color: #c62828;
}

.terminscheduler-cancellation-error h2 {
    color: #c62828;
    margin-bottom: 20px;
}

.terminscheduler-cancellation-info {
    background: #f8f9fa;
    border: 1px solid #6c757d;
    color: #495057;
}

.terminscheduler-cancellation-info h2 {
    color: #495057;
    margin-bottom: 20px;
}

.terminscheduler-cancellation-success .button,
.terminscheduler-cancellation-error .button,
.terminscheduler-cancellation-info .button {
    display: inline-block;
    padding: 12px 24px;
    background: #007cba;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 20px;
    transition: background-color 0.3s ease;
}

.terminscheduler-cancellation-success .button:hover,
.terminscheduler-cancellation-error .button:hover,
.terminscheduler-cancellation-info .button:hover {
    background: #005a87;
    color: #fff;
}
