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

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

/* Main container */
.main-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header section */
.header-section {
    text-align: center;
    margin-bottom: 30px;
}

.logo-section h1 {
    color: #fff;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 8px;
}

.logo-section p {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.back-link {
    color: #fbbf24;
    text-decoration: none;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.back-link:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

/* Instructions alert section */
.instructions-alert {
    background: linear-gradient(135deg, #ff6b6b, #ffa726);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(16,185,129,0.3);
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.alert-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.alert-content h3 {
    color: #000;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.instruction-steps {
    margin-bottom: 15px;
}

.step {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    color: #000;
}

.step-number {
    background: rgba(255,255,255,0.2);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.step-text {
    font-size: 1rem;
}

.important-note {
    color: #000;
    font-size: 1rem;
    background: rgba(255,255,255,0.1);
    padding: 10px 15px;
    border-radius: 8px;
    margin: 0;
}

/* Form container */
.form-container {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.form-header {
    text-align: center;
    margin-bottom: 25px;
}

.form-header h2 {
    color: #333;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.form-header p {
    color: #666;
    font-size: 1rem;
}

/* Input group */
.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 1rem;
    flex-wrap: wrap;
}

.label-icon {
    font-size: 1.1rem;
}

.example-text, .help-text {
    color: #888;
    font-weight: 400;
    font-size: 0.9rem;
}

.input-group input[type="text"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.input-group input[type="text"]:focus {
    outline: none;
    border-color: #4f46e5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.input-help {
    margin-top: 5px;
}

.input-help small {
    color: #dc2626;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Get Code Button */
.get-code-button {
    width: 100%;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 15px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(79,70,229,0.4);
    position: relative;
}

.get-code-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79,70,229,0.5);
}

.get-code-button:active {
    transform: translateY(0);
}

.get-code-button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
}

.button-icon {
    font-size: 1.2rem;
}

.button-text {
    font-size: 1rem;
}

/* Loading spinner */
.loading-spinner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Timing notice */
.timing-notice {
    background: linear-gradient(135deg, #e862db, #ee10e3);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: #ffffff;
}

.notice-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.notice-content p {
    margin: 0;
    font-size: 0.95rem;
}

.notice-content p:first-child {
    font-weight: 600;
}

/* Code result section */
.code-result {
    background: linear-gradient(135deg, #20a107, #7acc32);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(5,150,105,0.25);
    color: #000000;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

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

.success-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.result-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.code-details {
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.detail-icon {
    font-size: 1.1rem;
}

.detail-value {
    font-weight: 500;
    text-align: right;
}

.code-item {
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

.code-container {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-end;
}

.code-value {
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    background: rgba(255,255,255,0.25);
    padding: 12px 16px;
    border-radius: 8px;
    letter-spacing: 2px;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.copy-button {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    backdrop-filter: blur(5px);
}

.copy-button:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.copy-button:active {
    transform: translateY(0);
    background: rgba(255,255,255,0.4);
}

.copy-icon {
    font-size: 1.2rem;
}

.code-instructions {
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 20px;
}

.code-instructions h4 {
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.code-instructions ol {
    padding-left: 20px;
}

.code-instructions li {
    margin-bottom: 8px;
    font-size: 1rem;
}

/* No code found section */
.no-code-found {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.no-code-found h3 {
    color: #dc2626;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.no-code-found > p {
    color: #666;
    font-size: 1rem;
    margin-bottom: 20px;
}

.error-message {
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    color: #991b1b;
}

.error-message p {
    margin: 0;
    font-size: 1rem;
}

.error-details {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    color: #92400e;
}

.error-details p {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.error-suggestions {
    background: #f3f4f6;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.error-suggestions h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.error-suggestions ul {
    padding-left: 20px;
    color: #555;
}

.error-suggestions li {
    margin-bottom: 5px;
}

/* Help section */
.help-section {
    margin-bottom: 30px;
}

.help-card {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
}

.help-header {
    margin-bottom: 25px;
}

.help-header h3 {
    color: #333;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.help-header p {
    color: #666;
    font-size: 1rem;
    margin: 0;
}

.support-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin: 25px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border-radius: 15px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: #059669;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
}

.stat-divider {
    width: 2px;
    height: 40px;
    background: linear-gradient(to bottom, transparent, #d1d5db, transparent);
}

.help-actions {
    margin: 25px 0;
}

.warranty-notice {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #f59e0b;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    text-align: left;
}

.notice-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.notice-icon {
    font-size: 1.2rem;
}

.notice-title {
    font-weight: 700;
    color: #92400e;
    font-size: 1rem;
}

.warranty-notice p {
    margin: 0;
    color: #92400e;
    font-size: 0.95rem;
    line-height: 1.5;
}

.discord-button {
    background: linear-gradient(135deg, #5865f2, #4f46e5);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.discord-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(88,101,242,0.4);
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
}

.footer p {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .main-container {
        padding: 0 10px;
    }

    .logo-section h1 {
        font-size: 2rem;
    }
    
    .instructions-alert {
        flex-direction: column;
        text-align: center;
    }

    .form-container {
        padding: 20px;
    }

    .help-card {
        padding: 20px;
    }
    
    .support-stats {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .stat-divider {
        width: 40px;
        height: 2px;
        background: linear-gradient(to right, transparent, #d1d5db, transparent);
    }
    
    .code-details .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .detail-value {
        text-align: left;
    }

    .code-container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .code-value {
        font-size: 1.2rem;
        text-align: center;
        letter-spacing: 1px;
    }

    .copy-button {
        align-self: center;
        width: auto;
        padding: 10px 20px;
    }
}

@media (max-width: 480px) {
    .logo-section h1 {
        font-size: 1.8rem;
    }
    
    .instructions-alert {
        padding: 20px;
    }
    
    .form-container {
        padding: 15px;
    }

    .input-group label {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* Language Selector Styles */
.language-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    backdrop-filter: blur(10px);
}

.language-selector label {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-right: 8px;
}

.language-selector select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.language-selector select:hover {
    border-color: #007bff;
}

.language-selector select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.support-notice {
    margin-top: 5px;
    text-align: center;
}

.support-notice small {
    color: #666;
    font-style: italic;
    font-size: 10px;
    line-height: 1.2;
}

/* Responsive adjustments for language selector */
@media (max-width: 768px) {
    /* Language selector stays fixed in top-right for mobile */
    .language-selector {
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 1002; /* Higher than mobile nav toggle */
        margin-bottom: 0;
        text-align: right;
    }
    
    body {
        padding: 10px;
    }

    .main-container {
        padding: 0 10px;
    }

    /* Add top margin to header section to avoid overlap with language selector */
    .header-section {
        margin-top: 60px; /* Add space for language selector */
        margin-bottom: 30px;
    }

    .logo-section h1 {
        font-size: 2rem;
    }
    
    .instructions-alert {
        flex-direction: column;
        text-align: center;
    }

    .form-container {
        padding: 20px;
    }

    .help-card {
        padding: 20px;
    }
    
    .support-stats {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .stat-divider {
        width: 40px;
        height: 2px;
        background: linear-gradient(to right, transparent, #d1d5db, transparent);
    }
    
    .code-details .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .detail-value {
        text-align: left;
    }

    .code-container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .code-value {
        font-size: 1.2rem;
        text-align: center;
        letter-spacing: 1px;
    }

    .copy-button {
        align-self: center;
        width: auto;
        padding: 10px 20px;
    }
}
