/* 
 * Trap Video Submission System
 * Mobile-first responsive styles
 */

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

html {
    font-size: 16px;
}

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

/* Container */
.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    min-height: 100vh;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 24px;
}

header h1 {
    font-size: 1.8rem;
    color: #1a1a2e;
    margin-bottom: 12px;
}

.reward-badge {
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 1.1rem;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.4);
}

.reward-badge .amount {
    font-weight: bold;
    font-size: 1.4rem;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.alert-error {
    background: #ffe0e0;
    color: #c0392b;
    border: 1px solid #e74c3c;
}

.alert-success {
    background: #e0ffe0;
    color: #27ae60;
    border: 1px solid #2ecc71;
}

/* Instructions */
.instructions {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.instructions h2 {
    font-size: 1.1rem;
    color: #1a1a2e;
    margin-bottom: 12px;
}

.instructions ul {
    list-style: none;
}

.instructions li {
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
}

.instructions .icon {
    font-size: 1.3rem;
}

/* Upload Section */
.upload-section {
    margin-bottom: 24px;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    border: 3px dashed #00b894;
    border-radius: 16px;
    background: #f0fdf9;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-label:hover {
    border-color: #00cec9;
    background: #e8faf5;
}

.upload-label.hidden {
    display: none;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.upload-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #00b894;
}

.upload-hint {
    font-size: 0.85rem;
    color: #666;
    margin-top: 8px;
}

input[type="file"] {
    display: none;
}

.video-preview {
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.video-preview.hidden {
    display: none;
}

.video-preview video {
    width: 100%;
    max-height: 300px;
}

.btn-remove {
    width: 100%;
    padding: 12px;
    background: #e74c3c;
    color: white;
    border: none;
    font-size: 1rem;
    cursor: pointer;
}

/* Form Sections */
.form-section {
    margin-bottom: 24px;
}

.form-section h3 {
    font-size: 1.1rem;
    color: #1a1a2e;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #444;
    font-size: 0.95rem;
}

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

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

.form-row {
    display: flex;
    gap: 12px;
}

.form-group-small {
    flex: 0 0 80px;
}

/* Payment Options */
.payment-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.payment-option {
    cursor: pointer;
}

.payment-option input {
    display: none;
}

.payment-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.payment-option input:checked + .payment-card {
    border-color: #00b894;
    background: #f0fdf9;
}

.payment-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.payment-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
}

.payment-details {
    animation: slideDown 0.3s ease;
}

.payment-details.hidden {
    display: none;
}

.cash-note {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 16px;
    font-style: italic;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Terms Section */
.terms-section {
    margin-top: 24px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
    cursor: pointer;
}

.checkbox-label a {
    color: #00b894;
    font-weight: 600;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 24px;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 184, 148, 0.5);
}

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

.btn-secondary {
    display: inline-block;
    padding: 14px 28px;
    background: #f0f0f0;
    color: #333;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Success Page */
.success-page {
    text-align: center;
    padding-top: 60px;
}

.success-icon {
    font-size: 5rem;
    margin-bottom: 24px;
}

.success-page h1 {
    font-size: 2rem;
    color: #00b894;
    margin-bottom: 16px;
}

.success-message {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 12px;
}

.success-details {
    color: #666;
    margin-bottom: 32px;
}

.success-box {
    background: #f8f9fa;
    padding: 24px;
    border-radius: 12px;
    text-align: left;
    margin-bottom: 32px;
}

.success-box ol {
    margin-top: 12px;
    padding-left: 24px;
}

.success-box li {
    padding: 6px 0;
}

/* Terms Page */
.terms-page {
    max-width: 700px;
}

.terms-page h1 {
    text-align: center;
    margin-bottom: 8px;
}

.terms-intro {
    text-align: center;
    color: #666;
    margin-bottom: 32px;
}

.terms-content section {
    margin-bottom: 28px;
}

.terms-content h2 {
    font-size: 1.1rem;
    color: #1a1a2e;
    margin-bottom: 12px;
}

.terms-content p {
    margin-bottom: 12px;
}

.terms-content ul {
    padding-left: 24px;
    margin-bottom: 12px;
}

.terms-content li {
    margin-bottom: 6px;
}

.terms-footer {
    text-align: center;
    padding-top: 32px;
    border-top: 2px solid #f0f0f0;
    margin-top: 32px;
}

.terms-footer p {
    margin-bottom: 20px;
    font-style: italic;
    color: #666;
}

/* ================================
   ADMIN STYLES
   ================================ */

.admin-body {
    background: #f0f2f5;
}

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

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #ddd;
}

.admin-header h1 {
    font-size: 1.5rem;
    color: #1a1a2e;
}

.admin-nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-nav {
    padding: 10px 18px;
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-nav:hover {
    background: #f8f9fa;
}

.btn-export {
    background: #00b894;
    color: white;
    border-color: #00b894;
}

.btn-export:hover {
    background: #00a383;
}

.btn-logout {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

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

/* Admin Stats */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #00b894;
}

/* Filters */
.filters {
    background: white;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.filter-form {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-form label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.filter-form select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
}

/* Submissions Table */
.table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.submissions-table {
    width: 100%;
    border-collapse: collapse;
}

.submissions-table th {
    background: #f8f9fa;
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    color: #666;
    border-bottom: 2px solid #e0e0e0;
}

.submissions-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

.submissions-table tr:hover {
    background: #fafafa;
}

.submissions-table tr.paid-row {
    background: #f0fff4;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-approved {
    background: #d4edda;
    color: #155724;
}

.status-rejected {
    background: #f8d7da;
    color: #721c24;
}

/* Payment Badges */
.payment-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.payment-paypal {
    background: #003087;
    color: white;
}

.payment-zelle {
    background: #6d1ed4;
    color: white;
}

.payment-cash {
    background: #2e7d32;
    color: white;
}

.payment-info {
    display: block;
    margin-top: 4px;
    color: #666;
    word-break: break-all;
    max-width: 150px;
}

/* Paid Badges */
.paid-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #00b894;
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.unpaid-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #e0e0e0;
    color: #666;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Action Buttons */
.actions-cell {
    min-width: 180px;
}

.action-buttons {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.inline-form {
    display: inline;
}

.btn-action {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.btn-action:hover {
    transform: scale(1.1);
}

.btn-approve {
    background: #d4edda;
    color: #155724;
}

.btn-reject {
    background: #f8d7da;
    color: #721c24;
}

.btn-paid {
    background: #fff3cd;
    color: #856404;
}

.btn-unpaid {
    background: #e0e0e0;
    color: #666;
}

.video-buttons {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
}

.btn-view-video {
    padding: 6px 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

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

.btn-download-video {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: none;
}

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

/* Copy Button */
.btn-copy {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 8px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background 0.2s;
}

.btn-copy:hover {
    background: #e0e0e0;
}

/* Copy Toast Notification */
.copy-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
}

.copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Notes */
.notes-section {
    margin-top: 8px;
}

.notes-input {
    width: 100%;
    min-height: 60px;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.85rem;
    resize: vertical;
}

.notes-input:focus {
    outline: none;
    border-color: #00b894;
}

/* No Submissions */
.no-submissions {
    background: white;
    padding: 60px 20px;
    text-align: center;
    border-radius: 12px;
    color: #666;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.modal-content video {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

/* Admin Login */
.admin-login {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.admin-login h1 {
    text-align: center;
    margin-bottom: 24px;
    color: #1a1a2e;
}

.login-form {
    margin-top: 24px;
}

/* Admin Settings */
.settings-sections {
    display: grid;
    gap: 24px;
}

.settings-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.settings-card h2 {
    font-size: 1.2rem;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.settings-card > p {
    color: #666;
    margin-bottom: 20px;
}

.settings-form {
    max-width: 400px;
}

/* QR Code Section */
.qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.qr-preview {
    padding: 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
}

.qr-preview img {
    max-width: 200px;
    height: auto;
}

.qr-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-download {
    display: inline-block;
    padding: 12px 24px;
    background: #00b894;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s ease;
}

.btn-download:hover {
    background: #00a383;
}

.qr-url {
    font-size: 0.9rem;
    color: #666;
}

.qr-url code {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .admin-nav {
        width: 100%;
    }
    
    .btn-nav {
        flex: 1;
        text-align: center;
    }
    
    .submissions-table {
        font-size: 0.85rem;
    }
    
    .submissions-table th,
    .submissions-table td {
        padding: 10px 8px;
    }
    
    .action-buttons {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 16px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .reward-badge {
        font-size: 1rem;
        padding: 10px 16px;
    }
    
    .reward-badge .amount {
        font-size: 1.2rem;
    }
    
    .payment-options {
        grid-template-columns: 1fr;
    }
    
    .payment-card {
        flex-direction: row;
        gap: 12px;
        padding: 14px;
    }
    
    .payment-icon {
        font-size: 1.5rem;
        margin-bottom: 0;
    }
}

/* ================================
   LOADING OVERLAY & SPINNER
   ================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.hidden {
    display: none;
}

.loading-content {
    text-align: center;
    color: white;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #00b894;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.loading-subtext {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Duration Warning */
.duration-warning {
    background: #fff3cd;
    color: #856404;
    padding: 10px 16px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 0.9rem;
    text-align: center;
}

.duration-warning.hidden {
    display: none;
}

.wake-lock-status {
    background: #d4edda;
    color: #155724;
    padding: 8px 12px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 0.85rem;
    text-align: center;
}

.wake-lock-status.hidden {
    display: none;
}


/* Disabled submit button */
.btn-submit:disabled {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-submit.uploading {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.btn-submit .btn-uploading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-submit .btn-uploading.hidden,
.btn-submit .btn-text.hidden {
    display: none;
}

.upload-status {
    font-weight: 600;
}

/* Progress Bar */
.progress-container {
    margin-top: 16px;
    text-align: center;
}

.progress-container.hidden {
    display: none;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00b894 0%, #00cec9 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: #666;
}
