/* 
* DU Sports Participation Web Application
* Main Stylesheet - Enhanced version
*/

:root {
    --du-green: #006838;
    --du-blue: #00447c;
    --light-gray: #f8f9fa;
    --border-color: #dee2e6;
    --text-color: #333;
    --error-color: #dc3545;
    --success-color: #28a745;
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-gray);
    padding-top: 20px;
    padding-bottom: 40px;
    position: relative;
    overflow-x: hidden;
}

/* Animated background */
.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(120deg, rgba(0, 104, 56, 0.05), rgba(0, 68, 124, 0.05));
    z-index: -1;
    overflow: hidden;
}

.animated-background:before {
    content: '';
    position: absolute;
    width: 300%;
    height: 300%;
    top: -100%;
    left: -100%;
    background-image: 
        radial-gradient(circle, rgba(0, 104, 56, 0.05) 10%, transparent 10.5%),
        radial-gradient(circle, rgba(0, 68, 124, 0.05) 10%, transparent 10.5%);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
    animation: backgroundMove 50s linear infinite;
    z-index: -1;
}

@keyframes backgroundMove {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    100% {
        transform: translate(-10%, -10%) rotate(1deg);
    }
}

.du-logo {
    max-height: 100px;
    margin-bottom: 30px;
    transition: transform 0.5s ease;
    border-radius: 15px; /* Changed from 50% to 15px for slightly rounded corners */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 0; /* Removed padding */
    background-color: transparent; /* No background */
    border: none; /* No border */
    max-width: 100%; /* Ensure responsive sizing */
}

.du-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); /* Enhanced shadow on hover */
}

.card {
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    border: none;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, var(--du-green), var(--du-blue));
    color: white;
    border-radius: 12px 12px 0 0 !important;
    padding: 20px;
    font-weight: 600;
}

.card-body {
    padding: 30px;
}

.form-section {
    margin-bottom: 25px;
    padding: 20px;
    border-radius: 10px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.form-section:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.form-section:last-child {
    margin-bottom: 10px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--du-blue);
    display: flex;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(0, 68, 124, 0.2);
}

.section-title i {
    margin-right: 10px;
    background: linear-gradient(135deg, var(--du-green), var(--du-blue));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.language-selector {
    text-align: right;
    margin-bottom: 20px;
}

.language-btn {
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 15px;
    margin-left: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-btn.active {
    background: linear-gradient(135deg, var(--du-green), var(--du-blue));
    color: white;
    border-color: transparent;
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--du-green);
    box-shadow: 0 0 0 0.2rem rgba(0, 104, 56, 0.25);
}

.btn-primary {
    background: linear-gradient(135deg, var(--du-green), var(--du-blue));
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, #005a30, #003968);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 104, 56, 0.3);
}

.invalid-feedback {
    display: block;
    color: var(--error-color);
    margin-top: 8px;
    font-size: 14px;
    font-weight: 500;
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    padding-left: 25px;
    position: relative;
}

.invalid-feedback:before {
    content: "\f071";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 0;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
    40%, 60% { transform: translate3d(3px, 0, 0); }
}

.is-invalid {
    border-color: var(--error-color) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23dc3545' viewBox='0 0 16 16'%3E%3Cpath d='M8 0a8 8 0 1 0 8 8 8 8 0 0 0-8-8zm0 14.5a6.5 6.5 0 1 1 6.5-6.5 6.5 6.5 0 0 1-6.5 6.5zm0-11a.5.5 0 0 0-.5.5v5a.5.5 0 0 0 1 0v-5a.5.5 0 0 0-.5-.5zm0 8a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    padding-right: calc(1.5em + 0.75rem) !important;
}

.success-page {
    text-align: center;
    padding: 60px 30px;
}

.success-page .du-logo,
.success-page img.du-logo {
    border-radius: 15px;
    padding: 0;
    background-color: transparent;
    border: none;
}

.success-icon {
    font-size: 100px;
    color: var(--success-color);
    margin-bottom: 30px;
    animation: bounce-in 1s cubic-bezier(0.37, 0.01, 0.19, 1.38);
}

@keyframes bounce-in {
    0% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 1; transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.success-title {
    background: linear-gradient(135deg, var(--du-green), var(--du-blue));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
}

.success-message {
    font-size: 18px;
    margin-bottom: 40px;
    color: #555;
}

footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    color: #6c757d;
    font-size: 14px;
}

/* Conditional Fields */
.conditional-field {
    display: none;
}

/* This approach was added but may conflict with the direct style manipulation in JS */
.conditional-field.visible {
    display: block;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* RTL Support for Arabic */
.rtl {
    direction: rtl;
    text-align: right;
}

.rtl .form-label:before {
    left: auto;
    right: 0;
}

.rtl .invalid-feedback {
    padding-left: 0;
    padding-right: 25px;
}

.rtl .invalid-feedback:before {
    left: auto;
    right: 0;
}

/* Floating labels */
.form-floating > .form-control,
.form-floating > .form-select {
    height: calc(3.5rem + 2px);
    padding: 1rem 0.75rem;
}

.form-floating > label {
    padding: 1rem 0.75rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .card-header {
        padding: 15px;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .section-title {
        font-size: 16px;
    }
}