/* 
* results/css/results.css
* Styles for the public-facing competition results page
*/

/* Results Page Container */
.results-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Result Detail Container - Use site width */
.result-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header Section - Full width like Skills for Success page */
.results-header {
    background: linear-gradient(135deg, #2a5298, #1e3c72);
    color: #fff;
    text-align: center;
    margin-bottom: 40px;
    padding: 80px 20px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.results-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background-image: url('../images/dots-pattern.png');
    background-size: contain;
    opacity: 0.1;
    z-index: 1;
}

.results-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 250px;
    height: 250px;
    background-image: url('../images/circles-pattern.png');
    background-size: contain;
    opacity: 0.1;
    z-index: 1;
}

.results-header h1 {
    color: #fff;
    font-size: 42px;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
    font-weight: 700;
}

.results-header p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    line-height: 1.6;
}

/* Results Tabs/Filters */
.results-tabs {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.results-tab {
    padding: 10px 20px;
    background-color: #f5f5f5;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.results-tab:hover {
    background-color: #e0e0e0;
}

.results-tab.active {
    background-color: var(--primary-color);
    color: white;
}

/* Year Sections */
.year-section {
    margin-bottom: 40px;
}

.year-title {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 24px;
    color: var(--primary-color);
}

/* Results Grid for Cards */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Result Card styling */
.result-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.result-card-header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px;
    position: relative;
}

.result-card-header h3 {
    margin: 0;
    font-size: 18px;
}

.result-date {
    font-size: 14px;
    margin-top: 5px;
    opacity: 0.9;
}

.result-type-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

.result-card-body {
    padding: 15px;
}

.result-location {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    color: #666;
}

.result-location i {
    margin-right: 5px;
    color: var(--primary-color);
}

.result-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.result-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s;
}

.result-btn i {
    margin-right: 5px;
}

.view-btn {
    background-color: var(--primary-color);
    color: white;
}

.view-btn:hover {
    background-color: #d45f1e;
}

.pdf-btn {
    background-color: #f1f1f1;
    color: #333;
}

.pdf-btn:hover {
    background-color: #e0e0e0;
}

/* Single Result View Styles */
.back-btn {
    display: inline-flex;
    align-items: center;
    margin-bottom: 20px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.back-btn i {
    margin-right: 5px;
}

.result-header {
    text-align: center;
    margin-bottom: 30px;
}

.result-header h1 {
    color: var(--primary-color);
    font-size: 32px;
    margin-bottom: 10px;
}

.result-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    color: #666;
    font-size: 15px;
}

.result-meta-item {
    display: flex;
    align-items: center;
}

.result-meta-item i {
    margin-right: 5px;
    color: var(--primary-color);
}

.result-description {
    margin: 0 auto 30px;
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    line-height: 1.6;
    max-width: 100%;
}

.result-download {
    text-align: center;
    margin-bottom: 30px;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    background-color: #2c3e50;
    color: white;
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.download-btn:hover {
    background-color: #1a2530;
}

.download-btn i {
    margin-right: 10px;
    font-size: 18px;
}

/* Result Images Gallery */
.result-images-container {
    margin-bottom: 40px;
    width: 100%;
}

.result-images-container h2 {
    margin-bottom: 25px;
    font-size: 28px;
    color: var(--primary-color);
    text-align: center;
}

/* Base result images grid */
.result-images-grid {
    display: grid;
    gap: 25px;
    width: 100%;
    margin: 0 auto;
}

/* Default column setting for fallback */
.result-images-grid {
    grid-template-columns: repeat(3, 1fr);
}

/* Column-specific styles */
.result-images-grid.columns-1 {
    grid-template-columns: 1fr;
}

.result-images-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.result-images-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.result-images-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.result-images-grid.columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

/* Image styling */
.result-image {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s;
    background-color: #fff;
    position: relative;
    /* Use aspect-ratio instead of fixed height */
    aspect-ratio: 4/3;
}

.result-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.result-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Use contain instead of cover to prevent cropping */
    display: block;
    background-color: #f9f9f9; /* Light background for transparent images */
}

/* Lightbox styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.lightbox-content {
    position: relative;
    max-width: 80%; /* Reduced width to make room for arrows */
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    border: 5px solid white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.lightbox-image.light-image {
    background-color: #f0f0f0;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 40px;
    height: 40px;
    background-color: transparent;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    z-index: 1010;
}

/* Navigation arrows positioned outside the image */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: #ff8800; /* Orange background */
    border: none;
    border-radius: 50%;
    color: #fff; /* White arrow icon */
    font-size: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1010;
    transition: background-color 0.3s, transform 0.3s;
}

.lightbox-prev {
    left: -80px; /* Positioned outside to the left */
}

.lightbox-next {
    right: -80px; /* Positioned outside to the right */
}

.lightbox-nav:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

/* Responsive adjustments for the lightbox */
@media (max-width: 1200px) {
    .lightbox-content {
        max-width: 75%;
    }
    
    .lightbox-prev {
        left: -60px;
    }
    
    .lightbox-next {
        right: -60px;
    }
}

@media (max-width: 992px) {
    .lightbox-content {
        max-width: 70%;
    }
    
    .lightbox-prev {
        left: -50px;
    }
    
    .lightbox-next {
        right: -50px;
    }
}

@media (max-width: 768px) {
    .lightbox-content {
        max-width: 85%;
    }
    
    .lightbox-close {
        top: -30px;
        right: -10px;
    }
    
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .lightbox-prev {
        left: 10px; /* For mobile, allow them to overlap slightly */
    }
    
    .lightbox-next {
        right: 10px; /* For mobile, allow them to overlap slightly */
    }
}

/* For very small screens */
@media (max-width: 480px) {
    .lightbox-content {
        max-width: 90%;
    }
    
    .lightbox-nav {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

/* Go Top Button */
#go-top-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    text-align: center;
    line-height: 40px;
    border-radius: 50%;
    font-size: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 99;
    transition: background-color 0.3s;
}

#go-top-btn:hover {
    background-color: #d45f1e;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .results-header h1 {
        font-size: 28px;
    }
    
    .result-header h1 {
        font-size: 26px;
    }
    
    /* Responsive grid adjustments for smaller screens */
    .result-images-grid {
        gap: 15px;
    }
    
    /* Override column settings on smaller screens */
    .result-images-grid.columns-4,
    .result-images-grid.columns-5 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .results-tab {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .result-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    /* Force single column on very small screens */
    .result-images-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
}