/**
 * Frontend Styles for NAD Appointment Scheduler
 * Theme-friendly styling that adapts to most WordPress themes
 */

.nad-appointment-widget {
    max-width: 600px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.nad-appointment-form-wrapper {
    padding: 20px;
}

.nad-appointment-form {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nad-form-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin: 0 0 30px 0;
    padding: 0;
}

/* Step styles */
.nad-step {
    animation: fadeIn 0.3s ease-out;
}

.nad-step-date,
.nad-step-time,
.nad-step-form,
.nad-step-success {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.nad-back-button {
    background: transparent;
    border: 1px solid #ddd;
    color: #666;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    transition: all 0.2s;
}

.nad-back-button:hover {
    background: #f5f5f5;
    border-color: #999;
}

.nad-time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.nad-time-slot {
    background: #fff;
    border: 2px solid #ddd;
    color: #333;
    padding: 12px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    text-align: center;
}

.nad-time-slot:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}

.nad-time-slot.is-selected {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.nad-loading {
    text-align: center;
    color: #666;
    padding: 20px;
    font-style: italic;
}

.nad-error {
    color: #d63638;
    font-size: 13px;
    margin-top: 5px;
    display: block;
}

.nad-success-message {
    text-align: center;
    padding: 20px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    color: #155724;
    margin-bottom: 20px;
}

.nad-success-message h3 {
    margin: 0;
    color: #155724;
}

.nad-form-row {
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

.nad-form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    position: relative;
    text-align: left;
}

.nad-tooltip-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    background: transparent;
    border: none;
    padding: 4px;
    cursor: help;
    vertical-align: middle;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-width: 24px;
    min-height: 24px;
    border-radius: 50%;
    transition: all 0.2s;
}

.nad-tooltip-trigger:hover {
    background: rgba(0, 0, 0, 0.05);
}

.nad-tooltip-trigger:active {
    transform: scale(0.9);
}

.nad-tooltip-icon {
    font-size: 16px;
    color: #00a3d7;
    transition: all 0.2s;
    line-height: 1;
    display: inline-block;
}

.nad-tooltip-trigger:hover .nad-tooltip-icon {
    color: #0085b0;
    transform: scale(1.1);
}

/* Tooltip Modal */
.nad-tooltip-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.nad-tooltip-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.nad-tooltip-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
    z-index: 1;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nad-tooltip-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 5px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 2;
}

.nad-tooltip-modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

.nad-tooltip-modal-body {
    padding: 30px;
    padding-top: 40px;
}

.nad-tooltip-modal-text {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

.nad-form-row .required {
    color: #d63638;
    margin-left: 3px;
}

.nad-form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.nad-form-control:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.1);
}

.nad-form-control:invalid {
    border-color: #d63638;
}

.nad-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.nad-checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.nad-submit-button {
    width: 100%;
    background: #2271b1;
    color: #fff;
    padding: 14px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nad-submit-button:hover {
    background: #135e96;
    transform: translateY(-1px);
}

.nad-submit-button:active {
    transform: translateY(0);
}

.nad-submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.nad-form-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}

.nad-form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.nad-form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.nad-calendar-sync-prompt {
    margin-top: 30px;
    padding: 0;
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nad-calendar-sync-content {
    background: #ffffff;
    padding: 40px 30px;
    border-radius: 16px;
    border: 1px solid rgba(0, 163, 215, 0.15);
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.nad-calendar-sync-content:hover {
    box-shadow: 0 12px 32px rgba(0, 163, 215, 0.12);
    border-color: rgba(0, 163, 215, 0.25);
}

.nad-calendar-sync-icon {
    font-size: 56px;
    margin-bottom: 20px;
    color: #00a3d7;
    animation: pulse 2s infinite;
    display: inline-block;
}

.nad-calendar-sync-icon i {
    display: inline-block;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.nad-calendar-sync-content h3 {
    margin: 0 0 12px 0;
    font-size: 24px;
    color: #1a1a1a;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nad-calendar-sync-content p {
    margin: 0 0 30px 0;
    font-size: 15px;
    color: #666;
    line-height: 1.6;
}

.nad-calendar-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
}

.nad-calendar-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 28px;
    background: #00a3d7;
    color: #fff;
    text-decoration: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 163, 215, 0.25);
    min-width: 180px;
    justify-content: center;
    border: none;
    position: relative;
    overflow: hidden;
}

.nad-calendar-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.nad-calendar-link:hover::before {
    left: 100%;
}

.nad-calendar-link:hover {
    background: #0085b0;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 163, 215, 0.35);
}

.nad-calendar-link:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 163, 215, 0.3);
}

.nad-calendar-link i {
    font-size: 20px;
    line-height: 1;
}

.nad-calendar-link span {
    line-height: 1;
}

.nad-calendar-skip {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #666;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    margin-top: 10px;
}

.nad-calendar-skip:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.15);
    color: #333;
}

/* Legacy calendar links (for backward compatibility) */
.nad-calendar-links {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.nad-calendar-links h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
}

/* Appointment details */
.nad-appointment-details {
    margin-top: 30px;
    animation: fadeInUp 0.3s ease-out;
}

.nad-appointment-details-content {
    background: #ffffff;
    padding: 35px;
    border-radius: 16px;
    border: 1px solid rgba(0, 163, 215, 0.15);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.nad-appointment-details-content:hover {
    box-shadow: 0 12px 32px rgba(0, 163, 215, 0.12);
    border-color: rgba(0, 163, 215, 0.25);
}

.nad-appointment-details-content h3 {
    margin: 0 0 20px 0;
    font-size: 22px;
    color: #333;
    font-weight: 700;
    text-align: center;
}

.nad-appointment-info {
    margin-bottom: 25px;
}

.nad-appointment-additional-info {
    margin-top: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

.nad-appointment-additional-info p {
    margin: 0 0 10px 0;
}

.nad-appointment-additional-info p:last-child {
    margin-bottom: 0;
}

.nad-appointment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
}

.nad-appointment-item:last-child {
    border-bottom: none;
}

.nad-appointment-item strong {
    color: #666;
    font-weight: 600;
    min-width: 80px;
}

.nad-appointment-item span {
    color: #333;
    font-weight: 500;
    text-align: right;
    flex: 1;
}

.nad-share-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

.nad-share-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: #ffffff;
    color: #333;
    border: 1px solid rgba(0, 163, 215, 0.2);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.nad-share-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 163, 215, 0.1), transparent);
    transition: left 0.5s;
}

.nad-share-button:hover::before {
    left: 100%;
}

.nad-share-button:hover {
    background: #f8f9fa;
    border-color: rgba(0, 163, 215, 0.4);
    color: #00a3d7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 163, 215, 0.15);
}

.nad-share-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 163, 215, 0.1);
}

.nad-share-button i {
    font-size: 18px;
    line-height: 1;
    color: inherit;
}

.nad-share-button span {
    line-height: 1;
}

/* Responsive design */
@media (max-width: 768px) {
    .nad-appointment-form-wrapper {
        padding: 10px;
    }
    
    .nad-appointment-form {
        padding: 20px;
    }
    
    .nad-form-row {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .nad-form-row label {
        text-align: left !important;
    }
    
    .nad-form-title {
        font-size: 24px;
    }
    
    .nad-tooltip-modal-content {
        max-width: calc(100vw - 40px);
        margin: 20px;
    }
    
    .nad-calendar-sync-content {
        padding: 20px;
    }
    
    .nad-calendar-sync-icon {
        font-size: 36px;
    }
    
    .nad-calendar-sync-content h3 {
        font-size: 20px;
    }
    
    .nad-calendar-sync-content p {
        font-size: 14px;
    }
    
    .nad-calendar-buttons {
        flex-direction: column;
    }
    
    .nad-calendar-link {
        width: 100%;
        min-width: auto;
    }
    
    .nad-appointment-details-content {
        padding: 20px;
    }
    
    .nad-appointment-details-content h3 {
        font-size: 20px;
    }
    
    .nad-appointment-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .nad-appointment-item strong {
        min-width: auto;
    }
    
    .nad-appointment-item span {
        text-align: left;
    }
    
    .nad-share-buttons {
        flex-direction: column;
    }
    
    .nad-share-button {
        width: 100%;
        justify-content: center;
    }
    
    .nad-tooltip-trigger {
        min-width: 28px;
        min-height: 28px;
    }
    
    .nad-tooltip-icon {
        font-size: 20px;
    }
    
    .nad-tooltip-modal-body {
        padding: 25px;
        padding-top: 35px;
    }
    
    .nad-tooltip-modal-text {
        font-size: 15px;
    }
}

/* Dark mode support (if theme supports it) */
@media (prefers-color-scheme: dark) {
    .nad-appointment-form {
        background: #1e1e1e;
        color: #e0e0e0;
    }
    
    .nad-form-row label {
        color: #e0e0e0;
    }
    
    .nad-form-control {
        background: #ffffff;
        border-color: #444;
        color: #333;
    }
    
    .nad-calendar-links {
        background: #2d2d2d;
        border-color: #444;
    }
}

