/* style.css - Responsive styles for treasure hunt website */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Team image management */
.team-management {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    align-items: start;
}

.current-team-image,
.team-image-update,
.team-members-display {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
}

.team-image-container {
    cursor: pointer;
    position: relative;
    display: inline-block;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.team-image-container:hover {
    transform: scale(1.05);
}

.team-image {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    border: 3px solid #3498db;
}

.team-image-form {
    margin-top: 1rem;
}

.team-image-section {
    margin-bottom: 2rem;
}

.team-members-section h4,
.team-image-section h4 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.team-modal-info {
    margin-top: 2rem;
    text-align: left;
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
}

.team-modal-info h4 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.team-modal-info p {
    line-height: 1.6;
    margin: 0;
}

/* Team info display */
.team-info {
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
}

.team-info h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.team-info p {
    margin: 0;
    opacity: 0.9;
}

.team-details {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-left: 4px solid #3498db;
}

.team-details h4 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.team-info-sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.team-members {
    color: #7f8c8d;
    font-size: 0.75rem;
    line-height: 1.2;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.instruction {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    opacity: 0.9;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.team-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #ffd700;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Sections */
.section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.section h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-size: 1.8rem;
}

.section h3 {
    margin-bottom: 1rem;
    color: #34495e;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.btn-admin {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

/* Team selection */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.team-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.team-card:hover {
    transform: translateY(-4px);
    border-color: #3498db;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.team-card img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
}

.team-card h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.team-card p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-group small {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: block;
}

.form-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Challenges */
.challenges-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.challenge-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    border-left: 4px solid #3498db;
}

.challenge-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.challenge-number {
    background: #3498db;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.challenge-header h3 {
    flex: 1;
    margin: 0;
    color: #2c3e50;
}

.challenge-status {
    background: #27ae60;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.challenge-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Leaderboard */
.leaderboard-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.table-header,
.table-row {
    display: grid;
    grid-template-columns: 60px 1fr 100px 120px 100px;
    padding: 1rem;
    align-items: center;
    gap: 1rem;
}

.table-header {
    background: #34495e;
    color: white;
    font-weight: bold;
}

.table-row {
    border-bottom: 1px solid #ecf0f1;
}

.table-row:last-child {
    border-bottom: none;
}

.table-row:nth-child(even) {
    background: #f8f9fa;
}

.podium-1 {
    background: linear-gradient(135deg, #ffd700, #ffed4e) !important;
}

.podium-2 {
    background: linear-gradient(135deg, #c0c0c0, #e5e5e5) !important;
}

.podium-3 {
    background: linear-gradient(135deg, #cd7f32, #daa520) !important;
}

.col-rank {
    text-align: center;
    font-size: 1.2rem;
}

.col-score {
    font-weight: bold;
    color: #27ae60;
}

/* Admin panel */
.admin-nav {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.admin-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    min-height: 600px;
}

.admin-sidebar {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
}

.admin-sidebar h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.item-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    text-decoration: none;
    color: #2c3e50;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.item-link:hover,
.item-link.active {
    background: #3498db;
    color: white;
}

.item-number {
    background: #34495e;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: bold;
    flex-shrink: 0;
}

.item-title {
    flex: 1;
    font-size: 0.9rem;
}

.item-count {
    background: #e74c3c;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

.admin-main {
    background: white;
    border-radius: 12px;
    padding: 2rem;
}

.admin-welcome {
    text-align: center;
    padding: 4rem 2rem;
    color: #7f8c8d;
}

/* Images grid */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.image-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.image-card:hover {
    transform: translateY(-4px);
}

.image-container {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-card:hover .image-overlay {
    opacity: 1;
}

.challenge-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #3498db;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.image-info {
    padding: 1rem;
}

.image-info h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.image-info p {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.image-info small {
    color: #95a5a6;
    font-size: 0.8rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
}

.modal-content {
    position: relative;
    margin: 5% auto;
    width: 90%;
    max-width: 800px;
    max-height: 90%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.modal-header {
    background: #34495e;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-body {
    padding: 2rem;
    text-align: center;
}

.modal-body img {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: white;
}

.close:hover {
    opacity: 0.7;
}

/* Messages */
.error {
    background: #e74c3c;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.success {
    background: #27ae60;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.no-data {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 2rem;
}

/* Navigation buttons */
.navigation-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Scoring info */
.scoring-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.scoring-info ul {
    list-style: none;
    padding-left: 0;
}

.scoring-info li {
    padding: 0.3rem 0;
    position: relative;
    padding-left: 1.5rem;
}

.scoring-info li:before {
    content: "•";
    color: #3498db;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .team-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .team-grid {
        grid-template-columns: 1fr;
    }
    
    .challenge-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .challenge-actions {
        flex-direction: column;
    }
    
    .challenge-actions .btn {
        width: 100%;
    }
    
    .table-header,
    .table-row {
        grid-template-columns: 50px 1fr 70px 80px 70px;
        font-size: 0.9rem;
        padding: 0.8rem;
    }
    
    .admin-content {
        grid-template-columns: 1fr;
    }
    
    .admin-sidebar {
        order: 2;
    }
    
    .admin-main {
        order: 1;
    }
    
    .images-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .navigation-buttons {
        flex-direction: column;
    }
    
    .navigation-buttons .btn {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
    }
    
    .modal-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .modal-nav {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 1.5rem;
    }
    
    .team-card {
        padding: 1rem;
    }
    
    .challenge-item {
        padding: 1rem;
    }
    
    .table-header,
    .table-row {
        font-size: 0.8rem;
        padding: 0.6rem;
    }
    
    .item-title {
        font-size: 0.8rem;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    .btn,
    .navigation-buttons,
    .admin-nav {
        display: none;
    }
    
    .section {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}