/**
 * Alcohol Compliance - Age Gate Styles
 *
 * @author    Eclipse360
 * @copyright Eclipse360
 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
 */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

html.agegate-fullscreen,
html.agegate-fullscreen body {
    overflow: hidden;
    height: 100%;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
}

body.agegate-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
}

/* Background - Color mode (default) */
.agegate-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, var(--bg-color, #1a1a2e) 0%, #16213e 50%, #0f3460 100%);
}

.agegate-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 20% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 20%, rgba(255, 255, 255, 0.03) 0%, transparent 40%);
    animation: subtle-pulse 8s ease-in-out infinite;
}

/* Background - Image mode */
.agegate-bg-image .agegate-background {
    background: var(--bg-image) center center / cover no-repeat;
}

.agegate-bg-image .agegate-background::before {
    background: rgba(0, 0, 0, 0.5);
    animation: none;
}

@keyframes subtle-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Fullscreen mode */
.agegate-mode-fullscreen {
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden;
    height: 100vh;
    min-height: 100vh;
    width: 100vw;
}

.agegate-mode-fullscreen .agegate-container {
    max-width: none;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
}

.agegate-mode-fullscreen .agegate-card {
    background: var(--card-bg-color, rgba(255, 255, 255, 0.95));
    border-radius: 0;
    min-height: 100vh;
    height: 100vh;
    width: 100vw;
    max-width: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    box-shadow: none;
    overflow-y: auto;
}

.agegate-mode-fullscreen.agegate-bg-image .agegate-card {
    background: var(--card-bg-color, rgba(255, 255, 255, 0.9));
    backdrop-filter: blur(10px);
}

/* Main card container */
.agegate-container {
    width: 100%;
    max-width: 520px;
    animation: fade-in-up 0.6s ease-out;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.agegate-card {
    background: var(--card-bg-color, rgba(255, 255, 255, 0.95));
    border-radius: 20px;
    padding: 50px 40px;
    text-align: center;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4),
                0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

/* Logo */
.agegate-logo {
    margin-bottom: 30px;
}

.agegate-logo img {
    max-width: 150px;
    max-height: 150px;
    height: auto;
    object-fit: contain;
}

/* Title */
.agegate-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color, #1a1a2e);
    margin-bottom: 20px;
    line-height: 1.3;
}

/* Message */
.agegate-message {
    font-size: 16px;
    color: var(--text-color, #4a4a5a);
    opacity: 0.85;
    line-height: 1.6;
    margin-bottom: 35px;
}

/* Form fields */
.agegate-field {
    margin-bottom: 20px;
    text-align: left;
}

.agegate-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color, #4a4a5a);
    margin-bottom: 10px;
}

/* Select inputs */
.agegate-select {
    width: 100%;
    padding: 14px 40px 14px 16px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    color: var(--text-color, #333);
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.agegate-select:hover {
    border-color: var(--button-bg-color, #667eea);
}

.agegate-select:focus {
    outline: none;
    border-color: var(--button-bg-color, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Country selector full width */
.agegate-select-country {
    width: 100%;
}

/* Year only selector */
.agegate-select-year-only {
    width: 100%;
}

/* Date inputs row */
.agegate-date-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.agegate-date-inputs .agegate-select {
    width: auto;
    flex: 1;
    min-width: 80px;
}

.agegate-select-day {
    min-width: 85px;
    max-width: 100px;
}

.agegate-select-month {
    min-width: 130px;
    flex: 2;
}

.agegate-select-year {
    min-width: 100px;
    max-width: 120px;
}

/* Date label */
.agegate-date-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color, #4a4a5a);
    margin-bottom: 15px;
    text-align: center;
}

/* Checkbox wrapper */
.agegate-checkbox-wrapper {
    margin: 20px 0;
    text-align: left;
}

.agegate-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color, #4a4a5a);
}

.agegate-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--button-bg-color, #667eea);
}

.agegate-checkbox:checked {
    background-color: var(--button-bg-color, #667eea);
    border-color: var(--button-bg-color, #667eea);
}

/* Buttons container */
.agegate-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
    margin-bottom: 30px;
}

/* Base button styles */
.agegate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-height: 56px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Yes/Validate button - Primary action */
.agegate-btn-yes,
.agegate-btn-validate {
    background: var(--button-bg-color, #b8963e);
    color: var(--button-text-color, #ffffff);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    width: 100%;
}

.agegate-btn-yes:hover,
.agegate-btn-validate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    filter: brightness(1.1);
}

.agegate-btn-yes:active,
.agegate-btn-validate:active {
    transform: translateY(0);
}

/* No button - Secondary action */
.agegate-btn-no {
    background: transparent;
    color: var(--text-color, #666);
    border: 2px solid #ddd;
}

.agegate-btn-no:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: #ccc;
}

/* Date form */
.agegate-date-form {
    margin-bottom: 40px;
}

.agegate-date-inputs {
    margin-bottom: 25px;
}

/* Warning text */
.agegate-warning {
    font-size: 12px;
    color: var(--text-color, #888);
    opacity: 0.7;
    line-height: 1.5;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-style: italic;
}

/* Denial page specific styles */
.agegate-denied .agegate-card {
    border-top: 4px solid #e74c3c;
}

.agegate-denied .agegate-title {
    color: #c0392b;
}

.agegate-denied .agegate-icon {
    font-size: 64px;
    color: #e74c3c;
    margin-bottom: 20px;
}

/* Responsive design */
@media (max-width: 520px) {
    .agegate-card {
        padding: 40px 25px;
        border-radius: 16px;
    }

    .agegate-title {
        font-size: 24px;
    }

    .agegate-message {
        font-size: 15px;
    }

    .agegate-logo img {
        max-width: 120px;
        max-height: 120px;
    }

    .agegate-btn {
        padding: 14px 25px;
        font-size: 15px;
    }

    .agegate-date-inputs {
        flex-direction: column;
    }

    .agegate-date-inputs .agegate-select {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 360px) {
    body.agegate-body {
        padding: 15px;
    }

    .agegate-card {
        padding: 30px 20px;
    }

    .agegate-title {
        font-size: 22px;
    }
}

/* Accessibility - Focus states */
.agegate-btn:focus {
    outline: 3px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

.agegate-btn-no:focus {
    outline-color: rgba(0, 0, 0, 0.3);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .agegate-card {
        border: 2px solid #000;
    }

    .agegate-btn-yes,
    .agegate-btn-validate {
        background: #000;
    }

    .agegate-btn-no {
        border-color: #000;
        color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .agegate-container,
    .agegate-background::before {
        animation: none;
    }

    .agegate-btn {
        transition: none;
    }
}

/* Print styles */
@media print {
    .agegate-background {
        display: none;
    }

    .agegate-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
