/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    text-align: center;
    color: #2c3e50;
}

header p {
    text-align: center;
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* Hunt list styles */
.hunt-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    backdrop-filter: blur(10px);
}

.hunt-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.hunt-card h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.hunt-card p {
    color: #7f8c8d;
    margin-bottom: 10px;
}

.hunt-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-top: 10px;
}

/* Progress bar */
.progress-bar {
    position: relative;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    height: 30px;
    margin-top: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    border-radius: 20px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #2c3e50;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Back button */
.back-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-bottom: 15px;
    transition: background 0.2s;
}

.back-btn:hover {
    background: #2980b9;
}

/* Clue list */
.clue-item {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clue-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.clue-item.completed {
    background: rgba(76, 175, 80, 0.1);
    border-left: 4px solid #4CAF50;
}

.clue-status {
    font-size: 1.2rem;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    color: #2c3e50;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #7f8c8d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #e74c3c;
}

.modal-body {
    padding: 20px;
}

/* Button styles */
.reveal-btn, .location-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    margin: 10px 0;
    width: 100%;
    transition: background 0.2s;
}

.reveal-btn:hover, .location-btn:hover {
    background: #2980b9;
}

.location-btn {
    background: #e67e22;
    font-size: 1.1rem;
}

.location-btn:hover {
    background: #d35400;
}

.location-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* Location result */
.location-result {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
}

.location-result.success {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
    border: 2px solid #4CAF50;
}

.location-result.error {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 2px solid #e74c3c;
}

.location-result.checking {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
    border: 2px solid #3498db;
}

/* Answer section */
.answer {
    margin-top: 20px;
    padding: 20px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 10px;
    border: 2px solid #4CAF50;
}

.answer h3 {
    color: #4CAF50;
    margin-bottom: 15px;
    text-align: center;
}

.answer h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

/* Images */
.clue-image, .answer-image {
    width: 100%;
    max-width: 400px;
    border-radius: 10px;
    margin-top: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Utility classes */
.hidden {
    display: none !important;
}

.loading {
    text-align: center;
    padding: 40px;
    color: white;
    font-size: 1.2rem;
}

footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 20px;
    padding: 20px;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
        max-height: 95vh;
    }
    
    .hunt-card {
        padding: 15px;
    }
}

/* PWA specific styles */
.install-prompt {
    background: rgba(52, 152, 219, 0.9);
    color: white;
    padding: 15px;
    text-align: center;
    border-radius: 10px;
    margin-bottom: 20px;
}

.install-btn {
    background: white;
    color: #3498db;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    margin-left: 10px;
    cursor: pointer;
    font-weight: bold;
}

/* Create Hunt Button */
.header-actions, .footer-actions {
    text-align: center;
    margin-top: 15px;
}

.create-hunt-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    margin: 10px;
}

.create-hunt-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Refresh Button */
.refresh-btn {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    margin: 10px;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.refresh-btn:disabled {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Hunt Creation Form Styles */
.hunt-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.form-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.add-clue-section {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
}

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

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    align-items: end;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Clue Form Styles */
.clue-form {
    border: 2px solid #ecf0f1;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    background: #f8f9fa;
}

.clue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.clue-header h4 {
    color: #2c3e50;
    margin: 0;
}

.location-section {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.location-section h5 {
    color: #2c3e50;
    margin-bottom: 10px;
}

/* Button Styles */
.add-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.add-btn:hover {
    background: #219a52;
}

.remove-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.remove-btn:hover {
    background: #c0392b;
}

.location-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.location-btn:hover {
    background: #2980b9;
}

.location-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

.form-actions {
    text-align: center;
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.primary-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.secondary-btn {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 13px 28px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    background: #667eea;
    color: white;
}

/* Preview Modal Styles */
.modal.large .modal-content {
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
}

.modal pre {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    overflow: auto;
    max-height: 60vh;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    border: 1px solid #ecf0f1;
}

/* Clear Progress Button Styles */
.footer-actions {
    text-align: center;
    margin-top: 15px;
}

.hunt-actions {
    text-align: center;
    margin: 20px 0;
}

.clear-progress-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
    margin: 10px;
}

.clear-progress-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.clear-progress-btn:active {
    transform: translateY(0);
}

/* Celebration Overlay Styles */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.celebration-overlay.hidden {
    display: none;
    opacity: 0;
}

.celebration-message {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1001;
    max-width: 400px;
    margin: 20px;
}

.celebration-message h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #2c3e50;
    animation: celebrate-bounce 1s ease-in-out;
}

.celebration-message p {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin-bottom: 30px;
}

.celebration-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.celebration-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Firework Animations */
.fireworks {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ff6b6b;
    border-radius: 50%;
    box-shadow: 
        0 0 20px #ff6b6b,
        0 0 40px #ff6b6b,
        0 0 60px #ff6b6b;
}

.firework-1 {
    left: 20%;
    top: 30%;
    animation: firework-explosion-1 2s ease-out infinite;
}

.firework-2 {
    right: 20%;
    top: 20%;
    background: #4ecdc4;
    box-shadow: 
        0 0 20px #4ecdc4,
        0 0 40px #4ecdc4,
        0 0 60px #4ecdc4;
    animation: firework-explosion-2 2s ease-out infinite 0.5s;
}

.firework-3 {
    left: 50%;
    top: 40%;
    background: #45b7d1;
    box-shadow: 
        0 0 20px #45b7d1,
        0 0 40px #45b7d1,
        0 0 60px #45b7d1;
    animation: firework-explosion-3 2s ease-out infinite 1s;
}

@keyframes celebrate-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes firework-explosion-1 {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    15% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(15);
        opacity: 0;
    }
}

@keyframes firework-explosion-2 {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }
    15% {
        transform: scale(1) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(20) rotate(360deg);
        opacity: 0;
    }
}

@keyframes firework-explosion-3 {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }
    15% {
        transform: scale(1) rotate(-180deg);
        opacity: 1;
    }
    100% {
        transform: scale(18) rotate(-360deg);
        opacity: 0;
    }
}
