/* Entry Form Stylesheet for MGPS Digital Competitions */

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

h1 {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 300;
}

.beta-warning {
    background: #ffc107;
    color: #212529;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    margin: 0;
}

.noscript-warning {
    background: #dc3545;
    color: white;
    padding: 15px;
    text-align: center;
    margin: 0;
}

.form-container {
    padding: 40px;
}

.form-section {
    margin-bottom: 20px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007cba;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
}

.section-title::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #007cba;
    border-radius: 50%;
    margin-right: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 15px 25px;
    margin-bottom: 20px;
    align-items: start;
}

.form-group {
    display: contents;
}

.form-group-stacked {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

label {
    font-weight: 600;
    color: #555;
    padding: 12px 0;
    font-size: 14px;
    text-align: left;
    line-height: 1.3;
    white-space: nowrap;
}

label.stacked {
    text-align: left;
    padding: 0 0 8px 0;
    white-space: normal;
}

input[type="text"],
input[type="email"],
input[type="number"],
select,
input[type="file"] {
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    width: 100%;
    max-width: 500px;
}

input[type="email"] {
    max-width: 400px;
    min-width: 250px;
}

input[type="text"][id^="img_title"] {
    max-width: 350px;
}

input[type="text"][id="entrykey"] {
    max-width: 300px;
}

input[type="number"][id="compno"] {
    max-width: 100px;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

input[type="file"] {
    border-style: dashed;
    border-color: #007cba;
    background: #f8f9ff;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

input[type="checkbox"],
input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #007cba;
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.subject-definition {
    background: white;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #e1e5e9;
    margin: 15px 0;
    display: none;
}

.subject-definition.visible {
    display: block;
}

.subject-definition h4 {
    color: #007cba;
    margin: 0 0 15px 0;
    font-size: 16px;
}

.competition-requirements {
    background: #f8f9fa;
    border-left: 4px solid #007cba;
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 0 6px 6px 0;
}

.requirements-grid {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 20px;
    align-items: center;
    margin-bottom: 10px;
}

.requirement-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.requirement-number {
    background: #007cba;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.due-date {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    white-space: nowrap;
}

.file-upload-section {
    background: white;
    padding: 20px;
    border-radius: 6px;
    border: 2px dashed #007cba;
    margin: 15px 0;
    text-align: center;
}

.file-upload-section h3 {
    color: #007cba;
    margin-top: 0;
}

.image-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.image-upload-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #e1e5e9;
}

.image-upload-item.hidden {
    display: none;
}

.entrykey-field {
    display: none;
}

.entrykey-field.visible {
    display: block;
}

.captcha-section {
    text-align: left;
    margin: 30px 0;
}

.submit-section {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 40px;
    text-align: center;
    margin: 40px -40px 0 -40px;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.submit-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #28a745;
    border: 2px solid #28a745;
    padding: 18px 50px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    min-width: 200px;
}

.submit-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(40, 167, 69, 0.4);
    border-color: #20c997;
    color: #20c997;
}

.submit-btn:hover:before {
    left: 100%;
}

.submit-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

.progress-indicator {
    display: none;
    margin-top: 20px;
}

.progress-text {
    font-size: 18px;
    margin-bottom: 15px;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    margin: 10px 0;
    border: 1px solid #f5c6cb;
}

.success {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 4px;
    margin: 10px 0;
    border: 1px solid #c3e6cb;
}

.info-box {
    background: #e7f3ff;
    border: 1px solid #b8daff;
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
}

.info-box h4 {
    color: #004085;
    margin-top: 0;
}

.copyright {
    text-align: center;
    color: #6c757d;
    font-size: 12px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

.my-entries-link {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    color: #007cba;
    padding: 10px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.my-entries-link:hover {
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

/* Hide/show functionality for dynamic content */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    label {
        text-align: left;
        padding: 0 0 5px 0;
        white-space: normal;
    }
    
    .image-upload-grid {
        grid-template-columns: 1fr;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .my-entries-link {
        position: static;
        display: block;
        margin: 10px 0;
        text-align: center;
    }
    
    .header {
        padding: 20px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .submit-btn {
        padding: 15px 40px;
        font-size: 16px;
        min-width: 180px;
    }
    
    .captcha-section {
        text-align: center;
    }
    
    .requirements-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        text-align: center;
    }
    
    .due-date {
        white-space: normal;
    }
}

input[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #6c757d !important;
}

.uploading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.uploading-overlay.active {
    display: flex;
}

.uploading-message {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}