/**
 * AUHM Awards Form Styles
 * تصميم متناسق مع heritage-submit-form
 */

/* ==================== Reset & Variables ==================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    /* الألوان الذهبية */
    --gold-primary: #B08D57;
    --gold-dark: #8C6F45;
    --gold-light: #D4B88C;
    --gold-gradient: linear-gradient(145deg, #B08D57, #8C6F45);

    /* ألوان الخلفية - فاتحة */
    --bg-page: #F7F7F7;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --bg-section: #f8f9fa;

    /* ألوان النص */
    --text-primary: #343a40;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    --text-light: #868e96;

    /* ألوان الحدود */
    --border-color: #dee2e6;
    --border-light: #e9ecef;
    --border-input: #d1d8e0;

    /* ألوان الحالة */
    --success: #28a745;
    --success-bg: #e6ffed;
    --error: #dc3545;
    --error-bg: #f8d7da;

    /* التأثيرات */
    --shadow: 0 15px 40px rgba(0, 0, 0, 0.09);
    --shadow-gold: 0 6px 18px rgba(176, 141, 87, 0.35);
    --radius: 16px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

/* ==================== Page Container ==================== */
.auhm-awards-page-wrapper {
    background-color: var(--bg-page);
    padding: 40px 20px 60px;
    min-height: 100vh;
}

#auhm-awards-page {
    max-width: 900px;
    margin: 0 auto;
    direction: rtl;
    text-align: right;
    font-family: 'Cairo', sans-serif;
}

/* ==================== Logo ==================== */
.auhm-logo-container {
    text-align: center;
    margin-bottom: 25px;
}

.auhm-logo {
    max-width: 160px;
    height: auto;
    transition: var(--transition);
}

.auhm-logo:hover {
    transform: scale(1.03);
}

/* ==================== Header ==================== */
.auhm-header {
    text-align: center;
    margin-bottom: 35px;
}

.header-badge {
    display: inline-block;
    background: var(--gold-gradient);
    color: #fff;
    padding: 8px 25px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 15px;
    box-shadow: var(--shadow-gold);
}

.auhm-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auhm-subtitle {
    font-size: 1.1rem;
    color: var(--gold-primary);
    font-weight: 600;
    margin-bottom: 8px;
}

.auhm-tagline {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* ==================== Intro ==================== */
.auhm-intro {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 25px 30px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: var(--shadow);
}

.intro-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 15px;
}

.intro-icon svg {
    width: 100%;
    height: 100%;
    fill: var(--gold-primary);
}

.auhm-intro p {
    color: var(--text-secondary);
    line-height: 1.9;
    margin: 0;
}

/* ==================== Form Container ==================== */
.auhm-form {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 40px 50px;
    box-shadow: var(--shadow);
}

@media (max-width: 768px) {
    .auhm-form {
        padding: 25px 20px;
    }
}

/* ==================== Progress Bar ==================== */
.auhm-progress {
    margin-bottom: 40px;
}

.progress-bar {
    height: 6px;
    background: var(--border-light);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 25px;
}

.progress-fill {
    height: 100%;
    background: var(--gold-gradient);
    width: 20%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    max-width: 500px;
    margin: 0 auto;
}

.progress-steps .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.5;
    transition: var(--transition);
}

.progress-steps .step.active,
.progress-steps .step.completed {
    opacity: 1;
}

.step-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-section);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.step.active .step-num {
    background: var(--gold-primary);
    border-color: var(--gold-primary);
    color: #fff;
    box-shadow: var(--shadow-gold);
}

.step.completed .step-num {
    background: var(--gold-dark);
    border-color: var(--gold-dark);
    color: #fff;
}

.step-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.step.active .step-label,
.step.completed .step-label {
    color: var(--gold-primary);
}

/* ==================== Form Steps ==================== */
.form-step {
    display: none;
    animation: fadeIn 0.4s ease;
}

.form-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 35px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-light);
}

.step-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(176, 141, 87, 0.15) 0%, rgba(176, 141, 87, 0.05) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-icon svg {
    width: 28px;
    height: 28px;
    fill: var(--gold-primary);
}

.step-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold-primary);
    margin-bottom: 5px;
}

.step-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

/* ==================== Form Rows & Groups ==================== */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    margin-bottom: 25px;
}

.form-group {
    flex: 1 1 calc(50% - 12.5px);
    min-width: 280px;
    margin-bottom: 0;
}

.form-group.full-width {
    flex: 1 1 100%;
}

@media (max-width: 768px) {
    .form-group {
        flex: 1 1 100%;
        min-width: unset;
    }

    .form-row {
        gap: 0;
        margin-bottom: 0;
    }

    .form-row .form-group {
        margin-bottom: 20px;
    }
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.form-group label .required {
    color: var(--error);
    font-weight: 700;
}

/* Social Icons in Labels */
.social-icon {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.social-icon svg {
    width: 14px;
    height: 14px;
    fill: #fff;
}

.social-icon.facebook {
    background: #1877f2;
}

.social-icon.twitter {
    background: #000;
}

.social-icon.instagram {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.social-icon.snapchat {
    background: #fffc00;
}

.social-icon.snapchat svg {
    fill: #000;
}

.social-icon.whatsapp {
    background: #25d366;
}

/* ==================== Inputs ==================== */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="url"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(176, 141, 87, 0.2);
    background-color: #fff;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-light);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23868e96%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: left 18px center;
    background-size: 9px 9px;
    padding-left: 40px;
    height: 48px;
}

.form-group select option {
    background: #fff;
    color: var(--text-secondary);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.field-hint {
    display: block;
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.input-error {
    border-color: var(--error) !important;
    animation: shake 0.5s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }
}

/* ==================== File Upload ==================== */
.attachments-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .attachments-grid {
        grid-template-columns: 1fr;
    }
}

.file-upload-group label {
    margin-bottom: 10px;
}

.file-upload-box {
    border: 2px dashed var(--border-input);
    border-radius: 12px;
    padding: 35px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background-color: var(--bg-section);
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.file-upload-box:hover {
    border-color: var(--gold-primary);
    background-color: #faf8f5;
}

.file-upload-box .upload-icon {
    width: 45px;
    height: 45px;
    margin-bottom: 12px;
}

.file-upload-box .upload-icon svg {
    width: 100%;
    height: 100%;
    fill: var(--gold-primary);
}

.file-upload-box .upload-text {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.file-upload-box.has-file {
    border-color: var(--gold-primary);
    background-color: #faf8f5;
    border-style: solid;
}

.file-upload-box.has-file .upload-icon svg {
    fill: var(--success);
}

.file-upload-box.has-file .upload-text {
    color: var(--success);
    font-weight: 600;
}

.file-upload-box.dragover {
    border-color: var(--gold-primary);
    background-color: rgba(176, 141, 87, 0.1);
    transform: scale(1.02);
}

.file-preview {
    margin-top: 12px;
    text-align: center;
}

.file-preview img {
    max-width: 80px;
    max-height: 80px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

.file-preview .file-name {
    font-size: 0.85rem;
    color: var(--success);
    margin-top: 5px;
}

/* ==================== Category Cards ==================== */
.category-cards-wrapper {
    margin-top: 25px;
}

.cards-label {
    display: block;
    margin-bottom: 15px;
    color: var(--text-muted);
    font-weight: 600;
}

.category-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}

.category-card {
    padding: 18px 15px;
    background: var(--bg-section);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.category-card:hover {
    border-color: var(--gold-primary);
    background: #faf8f5;
    transform: translateY(-3px);
}

.category-card.selected {
    background: var(--gold-gradient);
    border-color: var(--gold-primary);
    color: #fff;
    box-shadow: var(--shadow-gold);
}

/* ==================== Terms Section ==================== */
.terms-section {
    margin-top: 30px;
}

.terms-box {
    background: var(--bg-section);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 20px 25px;
    margin-bottom: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.terms-box h3 {
    color: var(--gold-primary);
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.terms-box h3 svg {
    width: 20px;
    height: 20px;
    fill: var(--gold-primary);
}

.terms-box ul {
    padding-right: 20px;
    margin: 0;
}

.terms-box li {
    margin-bottom: 10px;
    color: var(--text-muted);
    line-height: 1.7;
}

.terms-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.terms-checkbox input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--gold-primary);
    cursor: pointer;
}

.checkbox-text {
    color: var(--text-secondary);
    font-weight: 600;
}

/* ==================== Navigation Buttons ==================== */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px dashed var(--border-light);
}

.btn {
    padding: 15px 35px;
    border: none;
    border-radius: 50px;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-arrow {
    font-size: 1.2rem;
    transition: var(--transition);
}

.btn-prev {
    background: var(--bg-section);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.btn-prev:hover:not(:disabled) {
    border-color: var(--gold-primary);
    color: var(--gold-primary);
    background: #faf8f5;
}

.btn-prev:hover:not(:disabled) .btn-arrow {
    transform: translateX(5px);
}

.btn-prev:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-next,
.btn-submit {
    background: var(--gold-gradient);
    color: #fff;
    box-shadow: var(--shadow-gold);
}

.btn-next:hover,
.btn-submit:hover {
    background: linear-gradient(145deg, #8C6F45, #705837);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(140, 111, 69, 0.45);
}

.btn-next:hover .btn-arrow {
    transform: translateX(-5px);
}

.btn-submit {
    min-width: 200px;
    justify-content: center;
    font-size: 1.1rem;
    padding: 16px 40px;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 2px solid var(--gold-primary);
    color: var(--gold-primary);
    padding: 14px 30px;
    margin-top: 20px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-back:hover {
    background: var(--gold-primary);
    color: #fff;
}

/* ==================== Messages ==================== */
.auhm-error-message {
    background-color: var(--error-bg);
    border: 1px solid #f5c6cb;
    border-left: 6px solid var(--error);
    color: #721c24;
    padding: 18px 25px;
    border-radius: var(--radius-sm);
    margin-bottom: 25px;
    animation: shake 0.5s ease;
    font-weight: 600;
}

.auhm-success-message {
    background-color: var(--success-bg);
    border: 1px solid #4CAF50;
    border-left: 6px solid var(--success);
    border-radius: var(--radius-sm);
    padding: 40px 30px;
    text-align: center;
}

.auhm-success-message .success-icon {
    width: 80px;
    height: 80px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.auhm-success-message .success-icon svg {
    width: 40px;
    height: 40px;
    fill: #fff;
}

.auhm-success-message h2 {
    color: #1b5e20;
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.auhm-success-message p {
    color: #2e7d32;
    font-size: 1rem;
    line-height: 1.8;
    margin: 0;
}

/* ==================== Footer ==================== */
.auhm-footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 25px;
}

.auhm-footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.auhm-footer a {
    color: var(--gold-primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.auhm-footer a:hover {
    color: var(--gold-dark);
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .auhm-awards-page-wrapper {
        padding: 25px 15px 40px;
    }

    .step-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .step-icon {
        width: 50px;
        height: 50px;
    }

    .step-icon svg {
        width: 24px;
        height: 24px;
    }

    .form-navigation {
        flex-direction: column-reverse;
        gap: 15px;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .progress-steps .step-label {
        display: none;
    }

    .step-num {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    .auhm-title {
        font-size: 1.5rem;
    }
}

/* ==================== Upload Progress Modal ==================== */
.upload-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.upload-progress-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.upload-progress-modal {
    position: relative;
    background: #fff;
    border-radius: 20px;
    padding: 40px 50px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.upload-progress-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    position: relative;
}

.upload-progress-icon svg {
    width: 40px;
    height: 40px;
    fill: var(--gold-primary);
    opacity: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.upload-progress-container.success .upload-progress-icon svg {
    opacity: 1;
    fill: var(--success);
    animation: checkmark 0.5s ease;
}

@keyframes checkmark {
    0% {
        transform: translate(-50%, -50%) scale(0);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

.upload-spinner {
    width: 80px;
    height: 80px;
    border: 4px solid var(--border-light);
    border-top-color: var(--gold-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.upload-progress-container.success .upload-spinner {
    border-color: var(--success);
    animation: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.upload-progress-title {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 25px;
    font-weight: 700;
}

.upload-progress-container.success .upload-progress-title {
    color: var(--success);
}

.upload-progress-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.upload-progress-bar {
    flex: 1;
    height: 12px;
    background: var(--border-light);
    border-radius: 10px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    background: var(--gold-gradient);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
}

.upload-progress-container.success .upload-progress-fill {
    background: linear-gradient(145deg, #4CAF50, #2E7D32);
}

.upload-progress-percent {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gold-primary);
    min-width: 55px;
}

.upload-progress-container.success .upload-progress-percent {
    color: var(--success);
}

.upload-progress-status {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

.upload-progress-container.hiding {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

/* ==================== Detailed Error Message ==================== */
.auhm-error-message {
    background-color: var(--error-bg);
    border: 1px solid #f5c6cb;
    border-right: 6px solid var(--error);
    color: #721c24;
    padding: 0;
    border-radius: var(--radius-sm);
    margin-bottom: 25px;
    animation: shake 0.5s ease;
    overflow: hidden;
}

.auhm-error-message .error-main {
    padding: 18px 25px;
    font-weight: 700;
    font-size: 1.1rem;
    background: rgba(220, 53, 69, 0.1);
    border-bottom: 1px solid #f5c6cb;
}

.auhm-error-message .error-details {
    padding: 15px 25px;
    background: #fff8f8;
    border-bottom: 1px solid #f5c6cb;
}

.auhm-error-message .error-details strong {
    display: block;
    margin-bottom: 8px;
    color: #856404;
}

.auhm-error-message .error-details code {
    display: block;
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 0.85rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: 'Courier New', monospace;
    direction: ltr;
    text-align: left;
}

.auhm-error-message .error-help {
    padding: 15px 25px;
    background: #fffef5;
}

.auhm-error-message .error-help strong {
    display: block;
    margin-bottom: 10px;
    color: #155724;
}

.auhm-error-message .error-help ul {
    margin: 0;
    padding-right: 20px;
}

.auhm-error-message .error-help li {
    margin-bottom: 6px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.auhm-error-message .error-help li:last-child {
    margin-bottom: 0;
}

/* Responsive for upload modal */
@media (max-width: 480px) {
    .upload-progress-modal {
        padding: 30px 25px;
    }
    
    .upload-progress-icon {
        width: 60px;
        height: 60px;
    }
    
    .upload-spinner {
        width: 60px;
        height: 60px;
    }
    
    .upload-progress-title {
        font-size: 1.2rem;
    }
    
    .upload-progress-percent {
        font-size: 1.1rem;
    }
}