/**
 * Main Stylesheet for NoOnes PHP Application
 * Compiled Tailwind-style CSS with Dark Mode Support
 */

/* ============================================================================
   CSS VARIABLES
   ============================================================================ */

:root {
    /* Colors */
    --primary: #3EBD69;
    --primary-hover: #35a55d;
    --primary-light: rgba(62, 189, 105, 0.1);
    
    /* Light Mode Colors */
    --bg-light: #f5f5f5;
    --card-bg-light: #ffffff;
    --text-light: #1a1a1a;
    --text-secondary-light: #6b7280;
    --border-light: #e5e7eb;
    --input-bg-light: #f9fafb;
    
    /* Dark Mode Colors */
    --bg-dark: #1a1a1a;
    --card-bg-dark: #262626;
    --text-dark: #ffffff;
    --text-secondary-dark: #999999;
    --border-dark: #3d3d3d;
    --input-bg-dark: #2d2d2d;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Font */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

input {
    font-family: inherit;
}

/* ============================================================================
   PAGE CONTAINER & THEME MODES
   ============================================================================ */

.page-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem var(--spacing-lg);
    padding-top: 4rem;
    transition: background-color 0.3s ease;
}

.page-container.light-mode {
    background-color: var(--bg-light);
    color: var(--text-light);
}

.page-container.dark-mode {
    background-color: var(--bg-dark);
    color: var(--text-dark);
}

/* ============================================================================
   LOADING OVERLAY
   ============================================================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(128, 128, 128, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

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

.loading-spinner {
    position: relative;
    width: 64px;
    height: 64px;
    background-color: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Dark mode spinner background */
.page-container.dark-mode ~ #loadingOverlay .loading-spinner,
#loadingOverlay .loading-spinner[data-theme="dark"],
body.has-dark-mode .loading-spinner {
    background-color: #1a1a1a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Light mode spinner background (default) */
.page-container.light-mode ~ #loadingOverlay .loading-spinner,
#loadingOverlay .loading-spinner[data-theme="light"],
body.has-light-mode .loading-spinner {
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.spinner-ring {
    position: absolute;
    width: 32px;
    height: 32px;
    border: 3px solid #3d3d3d;
    border-radius: 50%;
}

.spinner-ring-animated {
    position: absolute;
    width: 32px;
    height: 32px;
    border: 3px solid transparent;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ============================================================================
   LOGO
   ============================================================================ */

.logo-container {
    margin-bottom: var(--spacing-xl);
}

.logo {
    height: 48px;
    width: 144px;
}

/* ============================================================================
   CARD
   ============================================================================ */

.card {
    width: 100%;
    max-width: 500px;
    padding: 1.5rem 2rem;
    border-radius: var(--radius-xl);
}

.light-mode .card {
    background-color: var(--card-bg-light);
}

.dark-mode .card {
    background-color: var(--card-bg-dark);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: var(--spacing-sm);
}

.card-subtitle {
    font-size: 0.875rem;
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.light-mode .card-subtitle {
    color: var(--text-secondary-light);
}

.dark-mode .card-subtitle {
    color: var(--text-secondary-dark);
}

/* ============================================================================
   FORMS
   ============================================================================ */

.form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.form-label {
    font-size: 0.875rem;
    font-weight: 700;
}

.light-mode .form-label {
    color: #666666;
}

.dark-mode .form-label {
    color: #999999;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.light-mode .form-input {
    background-color: rgba(45, 45, 45, 0.1);
    border-color: #e0e0e0;
    color: var(--text-light);
}

.dark-mode .form-input {
    background-color: #2d2d2d;
    border-color: #3d3d3d;
    color: var(--text-dark);
}

.form-input::placeholder {
    font-weight: 600;
}

.light-mode .form-input::placeholder {
    color: #999999;
}

.dark-mode .form-input::placeholder {
    color: #777777;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input-small {
    font-size: 0.875rem;
    padding: 0.625rem 0.875rem;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .form-input {
    padding-right: 3rem;
}

.input-icon-btn {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.input-icon-btn:hover {
    opacity: 1;
}

.light-mode .input-icon-btn {
    color: var(--text-secondary-light);
}

.dark-mode .input-icon-btn {
    color: var(--text-secondary-dark);
}

.form-error {
    font-size: 0.75rem;
    color: #ef4444;
    margin-top: var(--spacing-xs);
}

.form-error.hidden {
    display: none;
}

.form-helper {
    font-size: 0.875rem;
    color: var(--primary);
    margin-top: var(--spacing-xs);
}

.form-helper.hidden {
    display: none;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn-primary {
    width: 100%;
    padding: 0.875rem 1rem;
    background-color: #3EBD69;
    color: #ffffff;
    border: 2px solid #2d9653;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
    margin-top: 0.5rem;
    outline: none;
}

.btn-primary:hover {
    background-color: #35a85d;
    border-color: #2a8a50;
}

.btn-primary:focus {
    box-shadow: 0 0 0 3px rgba(62, 189, 105, 0.4);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-confirm {
    margin-top: var(--spacing-sm);
}

/* ============================================================================
   OTP INPUTS
   ============================================================================ */

.otp-container {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: var(--spacing-lg);
}

.otp-input {
    width: 3rem;
    height: 3.5rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    border: 2px solid;
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.light-mode .otp-input {
    background-color: var(--input-bg-light);
    border-color: var(--border-light);
    color: var(--text-light);
}

.dark-mode .otp-input {
    background-color: var(--input-bg-dark);
    border-color: var(--border-dark);
    color: var(--text-dark);
}

.otp-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ============================================================================
   FOOTER CONTROLS (Theme Toggle & Language Selector)
   ============================================================================ */

.footer-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 500px;
    margin-top: var(--spacing-xl);
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.theme-icon {
    opacity: 0.8;
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 24px;
    background-color: var(--primary);
    border: none;
    border-radius: 4px;
    padding: 3px;
    transition: background-color 0.3s;
    cursor: pointer;
}

.toggle-knob {
    display: block;
    width: 18px;
    height: 18px;
    background-color: white;
    border-radius: 3px;
    transition: transform 0.2s, background-color 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-knob.dark {
    transform: translateX(24px);
    background-color: #1e1e1e;
}

/* Language Selector */
.language-selector {
    position: relative;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    background: none;
    border: none;
    font-size: 0.875rem;
    cursor: pointer;
    color: var(--primary);
    text-decoration: underline;
    transition: opacity 0.2s;
}

.language-btn:hover {
    opacity: 0.8;
}

.light-mode .language-btn {
    color: var(--primary);
}

.dark-mode .language-btn {
    color: var(--primary);
}

.language-btn svg {
    transition: transform 0.2s;
    stroke: var(--primary);
}

.language-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 0.5rem;
    min-width: 180px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    z-index: 50;
    background-color: #1a1a1a;
    border: none;
    overflow: hidden;
}

.language-dropdown.hidden {
    display: none;
}

.language-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    text-align: left;
    font-size: 0.875rem;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s;
}

.language-option:hover {
    background-color: #3EBD69;
}

.language-option.active {
    background-color: #3EBD69;
}

.flag-icon {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
}

/* ============================================================================
   DEVICE PAGE SPECIFIC
   ============================================================================ */

.device-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.device-image-container {
    width: 100%;
    max-width: 300px;
    margin-bottom: var(--spacing-lg);
}

.device-image {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
}

.device-instructions {
    font-size: 0.875rem;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    color: var(--text-light);
}

.dark-mode .device-instructions {
    color: var(--text-dark);
}

.device-instructions .user-email {
    color: var(--primary);
    font-weight: 500;
}

.device-form {
    width: 100%;
}

.device-form .form-group {
    width: 100%;
}

/* ============================================================================
   CHECK PAGE SPECIFIC
   ============================================================================ */

.check-page {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 4rem var(--spacing-xl);
}

.check-page.light-mode {
    background-color: var(--bg-light);
    color: var(--text-light);
}

.check-page.dark-mode {
    background-color: var(--bg-dark);
    color: var(--text-dark);
}

.check-content {
    text-align: center;
    max-width: 500px;
}

.rocket-icon {
    margin-bottom: var(--spacing-xl);
}

.check-title {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.check-domain {
    color: var(--primary);
    font-weight: 600;
}

.check-description {
    font-size: 0.875rem;
    margin: var(--spacing-lg) 0;
}

.light-mode .check-description {
    color: var(--text-secondary-light);
}

.dark-mode .check-description {
    color: var(--text-secondary-dark);
}

.check-timer {
    font-size: 0.875rem;
    margin-bottom: var(--spacing-lg);
}

.countdown {
    font-weight: 700;
    color: var(--primary);
}

.check-divider {
    border: none;
    border-top: 1px solid;
    margin: var(--spacing-lg) 0;
}

.light-mode .check-divider {
    border-color: var(--border-light);
}

.dark-mode .check-divider {
    border-color: var(--border-dark);
}

.check-info {
    font-size: 0.75rem;
    font-family: monospace;
}

.light-mode .check-info {
    color: var(--text-secondary-light);
}

.dark-mode .check-info {
    color: var(--text-secondary-dark);
}

/* ============================================================================
   INACTIVE PAGE SPECIFIC
   ============================================================================ */

.inactive-card {
    text-align: center;
}

.inactive-icon {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-lg);
}

.inactive-icon-circle {
    width: 80px;
    height: 80px;
    background-color: #FEF3C7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inactive-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.inactive-divider {
    width: 100%;
    height: 1px;
    margin: var(--spacing-md) 0;
}

.light-mode .inactive-divider {
    background-color: var(--border-light);
}

.dark-mode .inactive-divider {
    background-color: var(--border-dark);
}

.inactive-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.inactive-dot {
    width: 8px;
    height: 8px;
    background-color: #F59E0B;
    border-radius: 50%;
}

.inactive-text {
    font-size: 0.875rem;
    font-weight: 500;
}

.inactive-footer {
    font-size: 0.75rem;
    margin-top: var(--spacing-xl);
}

.light-mode .inactive-footer {
    color: var(--text-secondary-light);
}

.dark-mode .inactive-footer {
    color: var(--text-secondary-dark);
}

/* ============================================================================
   TOAST NOTIFICATIONS
   ============================================================================ */

.toast {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background-color: #262626;
    color: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    z-index: 1001;
}

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

.toast-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: bold;
}

.toast-success .toast-icon {
    background-color: var(--primary);
    color: white;
}

.toast-error .toast-icon {
    background-color: #ef4444;
    color: white;
}

.toast-message {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ============================================================================
   HIDDEN UTILITY
   ============================================================================ */

.hidden {
    display: none !important;
}

/* Utility Classes */
.text-primary {
    color: var(--primary);
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 480px) {
    .page-container {
        padding: var(--spacing-md);
    }
    
    .card {
        padding: var(--spacing-lg);
    }
    
    .otp-input {
        width: 2.5rem;
        height: 3rem;
        font-size: 1.25rem;
    }
    
    .footer-controls {
        flex-direction: row;
        justify-content: space-between;
        gap: var(--spacing-md);
        padding: 0;
    }
}

