/* Old Newspaper Aesthetic for Amjad Foundation Competition */

.foundation-newspaper-container {
    max-width: 850px;
    margin: 40px auto;
    padding: 70px 60px;
    background-color: #f8f1e5;
    background-image: url('https://www.transparenttextures.com/patterns/old-map.png');
    border: 3px solid #c5a059;
    /* Royal Gold */
    outline: 15px solid #f8f1e5;
    box-shadow: 0 0 0 16px #5d4037, 0 30px 60px rgba(0, 0, 0, 0.5);
    font-family: 'Amiri', serif;
    color: #3e2723;
    direction: rtl;
    position: relative;
    overflow: visible;
    /* Allow floating elements to peak out */
    transition: transform 0.3s ease;
}

.foundation-newspaper-container:hover {
    transform: translateY(-5px);
}

/* Floating Heritage Elements */
.heritage-float {
    position: absolute;
    pointer-events: none;
    z-index: 10;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
    animation: float-bob 6s ease-in-out infinite;
}

@keyframes float-bob {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

.palm-left {
    bottom: -50px;
    left: -80px;
    width: 180px;
    animation-delay: 0s;
}

.falcon-right {
    top: 50px;
    right: -60px;
    width: 120px;
    animation-delay: 2s;
}

.dallah-float {
    bottom: 150px;
    right: -50px;
    width: 100px;
    animation-delay: 4s;
}

/* Royal Header */
.newspaper-header h1 {
    font-family: 'Tajawal', sans-serif;
    font-size: 3.5rem;
    /* Reduced from 4.5rem to help fitting */
    margin: 0;
    font-weight: 900;
    color: #5d4037;
    text-shadow: 2px 2px 0px #c5a059;
    letter-spacing: -1px;
    line-height: 1.1;
}

.issue-date {
    font-size: 1.4rem;
    font-family: 'Amiri', serif;
    margin-top: 10px;
    font-style: italic;
    color: #c5a059;
    font-weight: bold;
}

.section-box {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #5d4037;
    background: rgba(255, 255, 255, 0.2);
}

.section-title-newspaper {
    text-align: center;
    position: relative;
    margin: 30px 0;
    font-family: 'Amiri', serif;
    font-size: 1.8rem;
    color: #fff;
    background: #5d4037;
    padding: 5px 20px;
    display: table;
    margin-left: auto;
    margin-right: auto;
    clip-path: polygon(10% 0, 90% 0, 100% 50%, 90% 100%, 10% 100%, 0 50%);
}

.section-title-newspaper::before,
.section-title-newspaper::after {
    content: "◈";
    margin: 0 10px;
}

.fill-blank-questions p {
    font-size: 1.2rem;
    margin-bottom: 15px;
    border-bottom: 1px dashed #5d4037;
    padding-bottom: 5px;
}

.fill-blank-questions input {
    border: none;
    border-bottom: 1px solid #5d4037;
    background: transparent;
    padding: 0 10px;
    width: auto;
    min-width: 150px;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.input-group input[type="text"],
.input-group input[type="email"],
.input-group select,
.city-input-row input,
textarea {
    width: 100%;
    padding: 12px;
    background: rgba(93, 64, 55, 0.05);
    /* Subtle brown tint */
    border: 1px solid transparent;
    border-bottom: 2px solid #c5a059;
    font-family: 'Amiri', serif;
    font-size: 1.1rem;
    color: #3e2723;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px;
    text-align: right;
}

.english-digits-only {
    direction: ltr !important;
    text-align: left !important;
    font-family: sans-serif !important;
}

.input-group input:focus,
.city-input-row input:focus,
textarea:focus {
    outline: none;
    background: rgba(197, 160, 89, 0.1);
    border-color: #c5a059;
    box-shadow: 0 4px 15px rgba(197, 160, 89, 0.2);
    transform: scale(1.01);
}

.city-input-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    direction: rtl;
}

.city-input-row label {
    flex: 0 0 120px;
    font-weight: bold;
    color: #5d4037;
    margin: 0;
}

.city-input-row input {
    flex: 1;
}

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

.input-group-row .input-group {
    flex: 1;
}

.newspaper-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.newspaper-table th,
.newspaper-table td {
    border: 1px solid #5d4037;
    padding: 10px;
    text-align: center;
}

.newspaper-table th {
    background: rgba(93, 64, 55, 0.1);
}

.mcq-questions label {
    display: block;
    margin: 10px 0;
    cursor: pointer;
}

.boolean-questions {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
}

.bool-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px dashed #5d4037;
    padding-bottom: 5px;
}

.bool-text {
    flex: 1;
    text-align: right;
}

.bool-options {
    display: flex;
    gap: 10px;
}

.newspaper-table input[type="text"] {
    border-bottom: 1px solid #5d4037;
    padding: 5px;
}

/* Winners Announcement */
.winners-announcement-banner {
    background: linear-gradient(135deg, #5c4033, #8b6b4d);
    color: #fff;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 35px;
    text-align: center;
    font-family: 'Tajawal', sans-serif;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 3px solid #c5a059;
    position: relative;
    overflow: hidden;
    animation: gold-glow 3s infinite alternate;
}

@keyframes gold-glow {
    from {
        box-shadow: 0 5px 15px rgba(197, 160, 89, 0.3);
    }

    to {
        box-shadow: 0 10px 40px rgba(226, 184, 91, 0.7);
    }
}

.winners-ranks-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.winner-rank-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.winner-rank-item:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.15);
}

.rank-top-1 {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.rank-top-2 {
    border-color: #c0c0c0;
    background: rgba(192, 192, 192, 0.1);
}

.rank-top-3 {
    border-color: #cd7f32;
    background: rgba(205, 127, 50, 0.1);
}

.rank-medal {
    font-size: 1.5rem;
}

.rank-label {
    font-weight: bold;
    color: #f8f1e5;
    font-size: 0.9rem;
}

.winner-name {
    font-size: 1.2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.general-winners-notice {
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Competition Closed Box */
.competition-closed-box {
    background: rgba(93, 64, 55, 0.1);
    border: 2px dashed #5d4037;
    padding: 40px;
    text-align: center;
    border-radius: 15px;
    margin: 40px 0;
}

.closed-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.competition-closed-box h3 {
    font-size: 2rem;
    color: #5d4037;
    margin-bottom: 10px;
}

.amjad-badge {
    background: #5d4037;
    color: #fff;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.edit-btn:hover {
    color: #135e96 !important;
}

.dashicons-trash:hover {
    color: #b32d2e !important;
}

/* Edit Modal specific styles */
#editParticipantModal .modal-content label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #5d4037;
}

#editParticipantModal hr {
    margin: 20px 0;
    border: none;
    border-top: 1px solid #ddd;
}

#submit-btn {
    background-color: #5d4037;
    color: #f4ecd8;
    border: none;
    padding: 15px 40px;
    font-size: 1.3rem;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    transition: background 0.3s;
    width: 100%;
    margin-top: 20px;
}

#submit-btn:hover {
    background-color: #3e2723;
}

#form-response {
    margin-top: 20px;
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.form-response-success {
    background: #e8f5e9;
    border: 2px solid #2e7d32;
    padding: 20px;
    border-radius: 10px;
    color: #1b5e20;
    font-weight: bold;
    margin-top: 20px;
    animation: slide-up 0.5s ease-out;
}

@keyframes slide-up {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.success-msg {
    font-size: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.success-msg::before {
    content: "✅";
    font-size: 2rem;
}

.form-response-error {
    background: #ffebee;
    border: 1px solid #c62828;
    padding: 15px;
    color: #c62828;
    margin-top: 20px;
    border-radius: 8px;
}

@media (max-width: 600px) {
    .foundation-newspaper-container {
        padding: 30px 15px;
        margin: 0;
        border-width: 5px;
        outline: none;
        box-shadow: none;
        width: 100%;
        max-width: 100%;
    }

    .newspaper-header h1 {
        font-size: 7vw;
        /* Dynamic sizing to prevent wrap */
        white-space: nowrap;
    }

    .issue-date {
        font-size: 1.1rem;
    }

    .input-group-row {
        flex-direction: column;
        gap: 15px;
    }

    .section-title-newspaper {
        font-size: 1.2rem !important;
        padding: 5px 15px !important;
        width: auto !important;
        margin: 20px auto !important;
        display: inline-block !important;
    }

    .input-group-row {
        flex-direction: column !important;
        gap: 15px !important;
    }

    .bool-item-row {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 5px !important;
        font-size: 0.9rem !important;
    }

    .bool-options {
        flex-shrink: 0 !important;
        gap: 5px !important;
    }

    .city-input-row label {
        flex: 0 0 100px;
    }

    .newspaper-table,
    .newspaper-table thead,
    .newspaper-table tbody,
    .newspaper-table th,
    .newspaper-table td,
    .newspaper-table tr {
        display: block;
    }

    .newspaper-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .newspaper-table td {
        border: none;
        border-bottom: 1px solid #5d4037;
        position: relative;
        padding-right: 50%;
        text-align: left;
    }

    .newspaper-table td:before {
        position: absolute;
        right: 10px;
        width: 45%;
        padding-left: 10px;
        white-space: nowrap;
        font-weight: bold;
        content: attr(data-label);
        text-align: right;
    }
}