/* ----------------------------
   General Reset & Body
---------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #0a0e27;
    background-image: 
        linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px),
        radial-gradient(circle at 20% 50%, rgba(0, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 150, 255, 0.1) 0%, transparent 50%);
    background-size: 50px 50px, 50px 50px, 100% 100%, 100% 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    line-height: 1.4;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 0% 0%, rgba(0, 255, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(0, 150, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ----------------------------
   Form Container
---------------------------- */
.container {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 255, 0.2);
    padding: 20px 30px;
    border-radius: 16px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(0, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    width: 1250px;
    max-width: 1250px;
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease-in;
    position: relative;
    z-index: 1;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.5), transparent);
    border-radius: 16px 16px 0 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container h2 {
    text-align: center;
    color: #ffffff;
    margin-bottom: 18px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #00ffff 0%, #0096ff 50%, #00ff88 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
    position: relative;
}

.container h2::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00ffff, transparent);
}

/* ----------------------------
   Form Layout - 3 Column Grid
---------------------------- */
form {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    overflow: visible;
}

form .form-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Submit button - centered and smaller width */
.form-submit {
    grid-column: 1 / -1;
    margin-top: 8px;
    width: 300px;
    margin-left: auto;
    margin-right: auto;
}

/* ----------------------------
   Labels
---------------------------- */
label {
    font-weight: 600;
    margin-bottom: 4px;
    color: #ffffff;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    display: block;
    text-transform: uppercase;
}

/* ----------------------------
   Input Fields & Selects
---------------------------- */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
select {
    padding: 8px 12px;
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: rgba(15, 23, 42, 0.8) !important;
    color: #e2e8f0 !important;
    width: 100%;
    font-family: inherit;
}

input::placeholder {
    color: #64748b;
    opacity: 0.6;
}

/* Override browser autofill/autocomplete styling */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus,
select:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px rgba(15, 23, 42, 0.8) inset !important;
    -webkit-text-fill-color: #e2e8f0 !important;
    background-color: rgba(15, 23, 42, 0.8) !important;
    background-clip: content-box !important;
    border: 1px solid rgba(0, 255, 255, 0.2) !important;
    transition: background-color 5000s ease-in-out 0s;
    color: #e2e8f0 !important;
}

input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px rgba(15, 23, 42, 0.95) inset, 0 0 0 3px rgba(0, 255, 255, 0.1), 0 0 20px rgba(0, 255, 255, 0.2), 0 0 10px rgba(0, 255, 255, 0.05) inset !important;
    -webkit-text-fill-color: #e2e8f0 !important;
    border-color: #00ffff !important;
}

/* Firefox autofill */
input:-moz-autofill,
input:-moz-autofill:hover,
input:-moz-autofill:focus {
    background-color: rgba(15, 23, 42, 0.8) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(0, 255, 255, 0.2) !important;
}

/* Autocomplete dropdown styling */
input::-webkit-contacts-auto-fill-button,
input::-webkit-credentials-auto-fill-button {
    visibility: hidden;
    display: none !important;
    pointer-events: none;
    height: 0;
    width: 0;
    margin: 0;
}

input:focus,
select:focus {
    border-color: #00ffff;
    outline: none;
    box-shadow: 
        0 0 0 3px rgba(0, 255, 255, 0.1),
        0 0 20px rgba(0, 255, 255, 0.2),
        inset 0 0 10px rgba(0, 255, 255, 0.05);
    transform: translateY(-1px);
    background-color: rgba(15, 23, 42, 0.95) !important;
}

input:hover:not(:focus),
select:hover:not(:focus) {
    border-color: rgba(0, 255, 255, 0.4);
    background-color: rgba(15, 23, 42, 0.9) !important;
}

/* Select styling */
select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: rgba(15, 23, 42, 0.8) !important;
    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='%2300ffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

/* Date input styling - Force dark background */
input[type="date"] {
    position: relative;
    background-color: rgba(15, 23, 42, 0.8) !important;
    color: #e2e8f0 !important;
}

input[type="date"]:focus {
    background-color: rgba(15, 23, 42, 0.95) !important;
}

input[type="date"]:hover:not(:focus) {
    background-color: rgba(15, 23, 42, 0.9) !important;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    filter: invert(1) brightness(0.8) sepia(1) hue-rotate(160deg) saturate(3);
    padding: 5px;
    margin-left: 5px;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    filter: invert(1) brightness(1) sepia(1) hue-rotate(160deg) saturate(3);
}

/* Ensure all inputs have consistent dark background */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="datetime-local"] {
    background-color: rgba(15, 23, 42, 0.8) !important;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
input[type="datetime-local"]:focus {
    background-color: rgba(15, 23, 42, 0.95) !important;
}

input[type="text"]:hover:not(:focus),
input[type="email"]:hover:not(:focus),
input[type="url"]:hover:not(:focus),
input[type="number"]:hover:not(:focus),
input[type="datetime-local"]:hover:not(:focus) {
    background-color: rgba(15, 23, 42, 0.9) !important;
}

/* ----------------------------
   Button Styling
---------------------------- */
button[type="submit"],
.form-submit {
    width: 300px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #00ffff 0%, #0096ff 50%, #00ff88 100%);
    border: 1px solid rgba(0, 255, 255, 0.5);
    border-radius: 10px;
    color: #0a0e27;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 8px;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 
        0 4px 15px rgba(0, 255, 255, 0.3),
        0 0 30px rgba(0, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

button[type="submit"]::before,
.form-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

button[type="submit"]:hover::before,
.form-submit:hover::before {
    left: 100%;
}

button[type="submit"]:hover,
.form-submit:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 25px rgba(0, 255, 255, 0.4),
        0 0 40px rgba(0, 255, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: rgba(0, 255, 255, 0.8);
}

button[type="submit"]:active,
.form-submit:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 10px rgba(0, 255, 255, 0.3),
        0 0 20px rgba(0, 255, 255, 0.2);
}

button[type="submit"]:disabled,
.form-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-loader {
    display: inline-block;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ----------------------------
   Response Boxes
---------------------------- */
.response-box {
    grid-column: 1 / -1;
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 10px;
    animation: slideDown 0.4s ease-out;
    width: 100%;
    box-sizing: border-box;
    clear: both;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.response-box.success-box {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2) 0%, rgba(0, 200, 100, 0.2) 100%);
    border: 1px solid rgba(0, 255, 136, 0.4);
    color: #00ff88;
    box-shadow: 
        0 4px 15px rgba(0, 255, 136, 0.2),
        0 0 20px rgba(0, 255, 136, 0.1);
}

.response-box.error-box {
    background: linear-gradient(135deg, rgba(255, 0, 100, 0.2) 0%, rgba(200, 0, 80, 0.2) 100%);
    border: 1px solid rgba(255, 0, 100, 0.4);
    color: #ff0064;
    box-shadow: 
        0 4px 15px rgba(255, 0, 100, 0.2),
        0 0 20px rgba(255, 0, 100, 0.1);
}

.response-box h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.debug-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 255, 255, 0.2);
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.debug-details summary {
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.debug-details summary:hover {
    background-color: rgba(0, 255, 255, 0.1);
}

.debug-details p {
    margin: 10px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.debug-details pre,
.debug-details code {
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 255, 255, 0.2);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #a0b3d0;
    display: block;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
    word-wrap: break-word;
    word-break: break-all;
}

.debug-details code {
    margin-top: 8px;
    white-space: pre-wrap;
    white-space: -moz-pre-wrap;
    white-space: -pre-wrap;
    white-space: -o-pre-wrap;
}

/* ----------------------------
   Responsive Design
---------------------------- */
@media (max-width: 1320px) {
    .container {
        width: 95%;
        max-width: 95%;
        padding: 20px 25px;
    }
}

@media (max-width: 1024px) {
    .container {
        width: 95%;
        max-width: 95%;
        padding: 18px 22px;
    }

    form {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .container {
        width: 95%;
        max-width: 95%;
        padding: 18px 20px;
    }

    .container h2 {
        font-size: 1.35rem;
        margin-bottom: 15px;
    }

    form {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    form .form-group {
        width: 100%;
    }

    .form-submit {
        grid-column: 1;
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        width: 100%;
        max-width: 100%;
        padding: 15px 15px;
        border-radius: 12px;
    }

    .container h2 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }

    form {
        gap: 10px;
    }

    input[type="text"],
    input[type="email"],
    input[type="url"],
    input[type="number"],
    input[type="date"],
    input[type="datetime-local"],
    select {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    button[type="submit"],
    .form-submit {
        width: 100%;
        max-width: 280px;
        padding: 10px 18px;
        font-size: 0.85rem;
    }
}

/* ----------------------------
   Additional Enhancements
---------------------------- */
/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Focus visible for accessibility */
input:focus-visible,
select:focus-visible,
button:focus-visible {
    outline: 2px solid #00ffff;
    outline-offset: 2px;
}

/* Disabled state */
input:disabled,
select:disabled,
button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: rgba(15, 23, 42, 0.5);
    border-color: rgba(0, 255, 255, 0.1);
}
