html,
body {
    height: 100%;
    overflow-y: auto;
    scroll-behavior: smooth;
    font-family: 'Poppins', sans-serif;
}

/* CS-themed background */
.bg-pattern {
    background-color: #f0f8ff;
    position: relative;
    min-height: 100%;
    padding: 2rem 0;
}

.bg-pattern::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%232b6cb0' fill-opacity='0.05'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2323436f' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2V6h4V4H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.6;
    z-index: 0;
    pointer-events: none;
}

/* Animated code elements */
.code-rain {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

@keyframes codeRain {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(calc(100vh + 100px));
        opacity: 0;
    }
}

/* Ensure code elements are only visible when falling */
.code-text {
    position: absolute;
    color: rgba(35, 67, 111, 0.15);
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    font-weight: bold;
    user-select: none;
    pointer-events: none;
    white-space: nowrap;
    animation-name: codeRain;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    visibility: hidden;
}

/* Show only when actually falling (not at the top) */
.code-text.falling {
    visibility: visible;
}

.form-card {
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 10;
    animation: formAppear 0.8s ease-out;
}

@keyframes formAppear {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.progress-bar {
    height: 6px;
    background: linear-gradient(to right, #23436f 0%, #9c4221 100%);
    transition: width 0.3s ease;
    animation: progressFill 1.5s ease;
}

@keyframes progressFill {
    0% {
        width: 0;
    }

    100% {
        width: 100%;
    }
}

.input-field {
    transition: all 0.3s ease;
}

.input-field:focus {
    border: none;
    outline: none;
    box-shadow: 0 0 0 1.5px #24436F !important;
}

.section-header {
    position: relative;
    animation: fadeInLeft 0.6s ease-out;
}

/* Enhanced label styling */
label.block.text-sm.font-medium.text-gray-700 {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    letter-spacing: 0.3px;
    color: #28436D;
    transition: all 0.2s ease;
    position: relative;
    padding-left: 0.5rem;
    margin-bottom: 0.5rem !important;
}

/* Add a subtle indicator before the label */
label.block.text-sm.font-medium.text-gray-700::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 12px;
    background: linear-gradient(to bottom, #28436D, #075465);
    border-radius: 2px;
}

/* Animate labels when their input is focused */
.group:focus-within label.block.text-sm.font-medium.text-gray-700 {
    color: #075465;
    transform: translateX(3px);
}

@keyframes fadeInLeft {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Image upload area styles */
.upload-area {
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.upload-area:hover {
    transform: translateY(-3px);
    animation: none;
}

/* Image preview styles */
.image-preview-container {
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.image-preview {
    max-width: 150px;
    max-height: 200px;
    object-fit: cover;
    border: 3px solid #f0f4f8;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive styles for upload area */
@media (max-width: 768px) {
    .upload-area .drag-drop {
        display: none;
    }
    
    .upload-area {
        padding: 1rem !important;
    }
    
    .image-preview {
        max-width: 120px;
        max-height: 160px;
    }
}

.submit-btn {
    transition: all 0.3s ease;
    animation: buttonAppear 1s ease-out 0.5s backwards;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

@keyframes buttonAppear {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.circuit-pattern {
    position: fixed;
    z-index: -1;
    opacity: 0.07;
    animation: rotatePattern 120s linear infinite;
    pointer-events: none;
}

@keyframes rotatePattern {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Custom Select Styles */
.custom-select-container {
    position: relative;
    width: 100%;
}

.custom-select {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.custom-select-selected {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Custom scrollbar styling for select options */
.custom-select-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    max-height: 250px;
    overflow-y: auto;
    z-index: 50;
    display: none;
    border-radius: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: #28436D #f0f4f8;
}

/* Webkit browsers (Chrome, Safari, newer versions of Opera) */
.custom-select-options::-webkit-scrollbar {
    width: 8px;
}

.custom-select-options::-webkit-scrollbar-track {
    background: #f0f4f8;
    border-radius: 0 0.5rem 0.5rem 0;
}

.custom-select-options::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #28436D, #075465);
    border-radius: 4px;
}

.custom-select-options::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #1a325a, #053a47);
}

.custom-select-container.open .custom-select-options {
    display: block;
    animation: fadeInDown 0.3s ease-out;
}

.custom-select-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.custom-select-option:hover {
    background-color: #f3f4f6;
}

.custom-select-option.selected {
    background-color: #e6f7ff;
    font-weight: 500;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Searchable select styles */
.searchable-select-container .custom-select-options {
    max-height: 300px;
    overflow-y: auto;
}

.search-input {
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(35, 67, 111, 0.3);
}

/* Scrollbar styling for the options dropdown */
.custom-select-options::-webkit-scrollbar {
    width: 8px;
}

.custom-select-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.custom-select-options::-webkit-scrollbar-thumb {
    background: #c5c5c5;
    border-radius: 10px;
}

.custom-select-options::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.custom-select-container.open .custom-select-options {
    display: block;
    animation: fadeInDown 0.3s ease-out;
}

.custom-select-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.custom-select-option:hover {
    background-color: #f3f4f6;
}

.custom-select-option.selected {
    background-color: #e6f7ff;
    font-weight: 500;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Style for the chevron to rotate when dropdown is open */
.custom-select-container.open .fa-chevron-down {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

.fa-chevron-down {
    color: #28436D;
    transition: transform 0.3s ease;
}

.option-icon {
    color: #075465;
}

/* Form validation styles */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.validation-container {
    transition: all 0.3s ease;
}

.validation-errors li {
    margin-bottom: 0.25rem;
}

.error-icon {
    z-index: 10;
    font-size: 1rem;
}

/* Style for invalid inputs */
input.border-red-500:focus, 
.custom-select.border-red-500:focus {
    box-shadow: 0 0 0 1.5px #f56565 !important;
}

/* Ensure error icon doesn't overlap with other icons */
.custom-select .error-icon {
    right: 2rem;
}