/* Photo Contest 2025 Styles - Clean & Standard Version */

/* Variables */
:root {
    --pc-primary: #043e80;
    /* Deep Blue - Corporate Color */
    --pc-accent: #f5b500;
    /* Yellow/Gold - Corporate Color */
    --pc-bg-body: #f9f9fa;
    --pc-bg-card: #ffffff;
    --pc-text-main: #333333;
    --pc-text-sub: #666666;
    --pc-border: #e0e0e0;
}

/* Base */
.dpfp-photo-contest-gallery {
    background-color: var(--pc-bg-body);
    color: var(--pc-text-main);
    min-height: 100vh;
    font-family: 'Noto Sans JP', sans-serif;
    padding-bottom: 80px;
}

.dpfp-photo-contest-submit {
    background-color: var(--pc-bg-body);
    color: var(--pc-text-main);
    padding: 60px 0;
}

/* Hero Section */
.contest-hero {
    padding: 60px 20px;
    text-align: center;
    background: #fff;
    border-bottom: 1px solid var(--pc-border);
    margin-bottom: 40px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.contest-period-selector {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 15px;
    border-radius: 30px;
    border: 1px solid var(--pc-border);
    font-size: 0.9rem;
    color: var(--pc-text-sub);
    z-index: 10;
}

.contest-period-selector label {
    margin-right: 8px;
    font-weight: bold;
    color: var(--pc-primary);
}

.contest-period-selector select {
    border: 1px solid var(--pc-border);
    border-radius: 4px;
    padding: 4px 8px;
    color: var(--pc-text-main);
    background: #fff;
    cursor: pointer;
}

.contest-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    margin-top: 20px;
    /* Add space for selector if needed on mobile */
    color: var(--pc-primary);
    letter-spacing: 0.05em;
}

/* Concurrent Contests */
.concurrent-contests-wrap {
    background: #eef7ff;
    border: 2px solid var(--pc-primary);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    text-align: center;
    width: 100%;
    max-width: 600px;
}

.concurrent-label {
    font-weight: bold;
    color: var(--pc-primary);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.concurrent-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.concurrent-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #fff;
    color: var(--pc-primary);
    border: 1px solid var(--pc-primary);
    border-radius: 20px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.concurrent-btn:hover {
    background: var(--pc-primary);
    color: #fff;
}

.contest-status-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.contest-status-badge.voting {
    background: var(--pc-accent);
    color: #fff;
    box-shadow: 0 2px 10px rgba(245, 181, 0, 0.3);
}

.contest-status-badge.entry-open {
    background: #00b0ff;
    color: #fff;
    box-shadow: 0 2px 10px rgba(0, 176, 255, 0.3);
}

.contest-status-badge.upcoming {
    background: #eee;
    color: #777;
}

.contest-status-badge.ended {
    background: var(--pc-primary);
    color: #fff;
}

.contest-period {
    font-size: 1rem;
    color: var(--pc-text-sub);
    font-weight: 500;
}

.contest-cta-btn {
    display: inline-block;
    margin-top: 30px;
    padding: 14px 40px;
    background: var(--pc-primary);
    color: #fff;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
    box-shadow: 0 4px 12px rgba(4, 62, 128, 0.2);
}

.contest-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(4, 62, 128, 0.3);
    background: #032d5e;
    color: #fff;
}

/* Grid & Items */
.contest-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.contest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.contest-item {
    background: var(--pc-bg-card);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--pc-border);
}

.contest-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.contest-item-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.contest-lightbox-link {
    display: block;
    overflow: hidden;
    position: relative;
    padding-top: 75%;
    /* 4:3 */
    background: #f0f0f0;
}

.contest-lightbox-link img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s;
    background: #000;
    /* Better contrast for photos */
}

.contest-item:hover .contest-lightbox-link img {
    transform: scale(1.05);
}

.contest-item-meta {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.contest-item-title {
    font-size: 1.1rem;
    margin: 0 0 5px;
    font-weight: 700;
    color: var(--pc-text-main);
    line-height: 1.4;
}

.contest-item-creator {
    font-size: 0.85rem;
    color: var(--pc-text-sub);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.contest-item-creator::before {
    content: '\f007';
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--pc-primary);
    opacity: 0.6;
}

.contest-action-area {
    margin-top: auto;
    display: flex;
    gap: 8px;
    /* Space between buttons */
}

/* Vote Button */
.vote-btn {
    flex: 1;
    /* Take remaining space */
    padding: 10px;
    border: 1px solid var(--pc-primary);
    border-radius: 6px;
    background: #fff;
    color: var(--pc-primary);
    cursor: pointer;
    transition: 0.2s;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
}

.vote-btn:hover:not(.voted):not([disabled]) {
    background: var(--pc-primary);
    color: #fff;
}

.vote-btn.voted {
    background: var(--pc-primary);
    color: #fff;
    opacity: 0.8;
    cursor: default;
    border-color: var(--pc-primary);
}

/* Ranking Badge */
.rank-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--pc-accent);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-size: 0.9rem;
}

.contest-item.rank-1 {
    border: 2px solid var(--pc-accent);
}

.contest-item.rank-2 .rank-badge {
    background: #999;
}

.contest-item.rank-3 .rank-badge {
    background: #cd7f32;
}

/* Result Count */
.vote-result {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--pc-primary);
    background: #f0f4f8;
    padding: 8px;
    border-radius: 6px;
}

/* Lightbox */
.pc-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.pc-lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.pc-lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    transition: transform 0.3s;
    background: #fff;
}

.pc-lightbox.active .pc-lightbox-content {
    transform: scale(1);
}

.pc-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Pagination */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 50px;
}

.pagination-wrapper .page-numbers {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: var(--pc-text-main);
    margin: 0 5px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
    border: 1px solid var(--pc-border);
}

.pagination-wrapper .page-numbers.current,
.pagination-wrapper .page-numbers:hover {
    background: var(--pc-primary);
    color: #fff;
    border-color: var(--pc-primary);
}

/* Submission Form */
.submit-form-wrapper {
    background: #fff;
    padding: 50px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    max-width: 800px;
    margin: 0 auto;
    border-top: 5px solid var(--pc-primary);
}

.page-title {
    text-align: center;
    margin-bottom: 20px;
    font-size: 2rem;
    font-weight: 700;
    color: var(--pc-text-main);
}

.page-desc {
    text-align: center;
    color: var(--pc-text-sub);
    margin-bottom: 40px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--pc-text-main);
}

.required {
    color: var(--pc-accent);
    margin-left: 4px;
}

.form-control {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--pc-border);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
    box-sizing: border-box;
    background: #fcfcfc;
}

.form-control:focus {
    border-color: var(--pc-primary);
    outline: none;
    background: #fff;
}

.form-help {
    font-size: 0.85rem;
    color: #888;
    margin-top: 6px;
}

/* File Drop Area */
.file-drop-area {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    border: 2px dashed var(--pc-border);
    border-radius: 8px;
    background-color: #fafafa;
    transition: 0.3s;
    cursor: pointer;
    padding: 20px;
    box-sizing: border-box;
}

.file-drop-area:hover,
.file-drop-area.is-active {
    background-color: #f0f7ff;
    border-color: var(--pc-primary);
}

.file-input {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-msg {
    color: var(--pc-text-sub);
    text-align: center;
    pointer-events: none;
    font-weight: 500;
}

#file-preview-area {
    margin-top: 20px;
    text-align: center;
}

#file-preview-area img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 18px;
    background: var(--pc-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(4, 62, 128, 0.3);
    background: #03336b;
}

/* Checkbox */
.form-check {
    display: flex;
    align-items: start;
    gap: 10px;
    margin-bottom: 30px;
}

.form-check label {
    font-size: 0.95rem;
    line-height: 1.6;
    cursor: pointer;
    color: var(--pc-text-main);
}

.form-check input {
    margin-top: 5px;
    accent-color: var(--pc-primary);
}

.submit-message.success {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #c8e6c9;
}

.submit-message.error {
    background: #ffebee;
    color: #c62828;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #ffcdd2;
}

/* X Share Button */
.share-x-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #000;
    color: #fff;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    text-decoration: none;
    transition: background 0.3s, transform 0.2s;
    height: 40px;
    /* Match vote btn height */
    box-sizing: border-box;
    margin-left: 10px;
}

.share-x-btn:hover {
    background: #333;
    transform: translateY(-2px);
    color: #fff;
}

/* Winners Podium */
.contest-winners-section {
    padding: 60px 20px;
    background: radial-gradient(circle at center, #fff9e6 0%, #fff 70%);
    text-align: center;
    border-bottom: 1px solid var(--pc-border);
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

/* Confetti Background Effect (Pseudo) */
.contest-winners-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle, #f5b500 2px, transparent 2.5px),
        radial-gradient(circle, #ff6b6b 2px, transparent 2.5px),
        radial-gradient(circle, #043e80 2px, transparent 2.5px);
    background-size: 40px 40px, 60px 60px, 50px 50px;
    background-position: 0 0, 20px 20px, 10px 10px;
    opacity: 0.1;
    animation: confettiMove 20s linear infinite;
    z-index: 0;
}

@keyframes confettiMove {
    from {
        background-position: 0 0, 20px 20px, 10px 10px;
    }

    to {
        background-position: 0 100%, 20px 120%, 10px 110%;
    }
}

.winners-title {
    font-size: 2rem;
    color: #d4a000;
    margin-bottom: 40px;
    font-weight: 900;
    text-shadow: 0 2px 4px rgba(212, 160, 0, 0.2);
    position: relative;
    z-index: 1;
}

.winners-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    max-width: 1200px;
    /* Increased from 900px */
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.winner-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 20px;
    position: relative;
    /* Standardize Podium heights */
    height: 100%;
}

.winner-card:hover {
    transform: translateY(-10px);
}

.winner-card.rank-1 {
    order: 2;
    /* Desktop: Center */
    z-index: 3;
    width: 36%;
    /* Reduced slightly from 40% to give space */
    padding: 30px;
    box-shadow: 0 15px 40px rgba(245, 181, 0, 0.3);
    border: 2px solid #ffd700;
}

.winner-card.rank-2 {
    order: 1;
    /* Desktop: Left */
    z-index: 2;
    width: 31%;
    /* Explicit width */
    margin-bottom: -10px;
    border-bottom: 5px solid #c0c0c0;
}

.winner-card.rank-3 {
    order: 3;
    /* Desktop: Right */
    z-index: 2;
    width: 31%;
    /* Explicit width */
    margin-bottom: -20px;
    border-bottom: 5px solid #cd7f32;
}

.winner-crown {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.rank-1 .winner-crown {
    color: #ffd700;
    font-size: 3.5rem;
    animation: floatCrown 3s ease-in-out infinite;
}

.rank-2 .winner-crown {
    color: #c0c0c0;
}

.rank-3 .winner-crown {
    color: #cd7f32;
}

@keyframes floatCrown {

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

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

.winner-rank-label {
    font-size: 1.2rem;
    font-weight: 900;
    margin-bottom: 10px;
    color: #333;
}

.rank-1 .winner-rank-label {
    color: #d4a000;
    font-size: 1.5rem;
}

.winner-image-wrap {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    aspect-ratio: 16/9;
    background: #f0f0f0;
    position: relative;
    /* Flex Center */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center;
}

/* Explicitly fill the container with the anchor */
.winner-podium-link {
    display: flex !important;
    width: 100%;
    height: 100%;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none;
    position: relative;
}

/* Constrain image to fit inside */
.winner-podium-img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    /* Force full width so Object Fit handles it */
    height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    /* CRITICAL FIX */
    display: block !important;
    margin: 0 auto !important;
    opacity: 1 !important;
    border: none !important;
}

.winner-image-wrap:hover .winner-podium-img {
    transform: scale(1.05);
    transition: transform 0.3s;
}

.winner-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 5px;
    line-height: 1.4;
}

.rank-1 .winner-title {
    font-size: 1.3rem;
}

.winner-creator {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 10px;
}

.winner-votes {
    background: #eee;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    color: #333;
}

.rank-1 .winner-votes {
    background: #ffd700;
    color: #fff;
    font-size: 1.2rem;
}

/* Grid adjustment */
.contest-grid-inner {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.grid-header-label {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 40px 0 20px;
    color: var(--pc-primary);
    width: 100%;
}

/* Mobile Responsive */
@media(max-width: 768px) {
    .winners-podium {
        flex-direction: column;
        align-items: center;
    }

    .winner-card {
        width: 100% !important;
        order: unset !important;
        /* Stack normally 1,2,3 */
        margin-bottom: 20px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .submit-form-wrapper {
        padding: 30px 20px;
    }

    .contest-title {
        font-size: 2rem;
    }

    .contest-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }

    .contest-item img {
        height: 100%;
    }
}

/* Fix for Missing Grid Layout */
.contest-grid-inner {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    width: 100%;
}

/* Load More Button */
#load-more-container {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 40px;
    width: 100%;
}

.btn-load-more {
    display: inline-block;
    padding: 12px 40px;
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
    background: #065ba8;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(6, 91, 168, 0.3);
}

.btn-load-more:hover {
    background: #043e80;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(6, 91, 168, 0.4);
}

#load-more-loading {
    font-size: 1rem;
    color: #666;
    font-weight: bold;
}

@media (max-width: 768px) {
    .contest-grid-inner {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .contest-grid-inner {
        grid-template-columns: 1fr;
    }
}

/* Lightbox High Z-Index Override */
.pc-lightbox {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 999999 !important;
    /* Ensure it stays on top of Header */
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.pc-lightbox.active {
    display: flex;
    opacity: 1;
}

.pc-lightbox-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.pc-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    line-height: 1;
    z-index: 1000000;
}