/* public/assets/css/style.css */
:root {
    --primary-color: #0056b3;
    --secondary-color: #004494;
    --background-color: #f4f7f6;
    --text-color: #333;
    --white: #ffffff;
    --error-color: #dc3545;
    --success-color: #28a745;
    --border-radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
}

/* Navbar Responsive */
.navbar {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-brand a {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--white);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1rem;
}

.nav-links a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 0.2rem;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 1rem;
}

/* Card Styling */
.card {
    background: var(--white);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.card h2 {
    margin-bottom: 1.25rem;
    font-size: 1.25rem;
    color: var(--primary-color);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
}

input, select, textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1.5px solid #eee;
    border-radius: 8px;
    font-size: 16px; /* Prevents auto-zoom on iOS */
    background: #f9f9f9;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0, 86, 179, 0.1);
}

button {
    width: 100%;
    padding: 0.9rem;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s;
}

button:hover {
    background-color: var(--secondary-color);
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.2);
}

button:active {
    transform: scale(0.97);
}

/* Tables - Responsive Wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 1rem;
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Forces scroll on small screens */
}

table th, table td {
    padding: 1rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

table tbody tr {
    transition: background-color 0.2s;
}

table tbody tr:hover td {
    background-color: #fcfcfc;
}

table th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #666;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
    background: linear-gradient(135deg, #0056b3 0%, #004494 100%);
}

.login-container {
    background: var(--white);
    padding: 2.5rem 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
    font-size: 1.75rem;
}

/* Plans Grid */
.plans-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.plan-card {
    border: 2px solid #f0f0f0;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    transition: all 0.2s;
    position: relative;
    background: var(--white);
}

.plan-card.promo-active {
    border-color: #ffc107;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.1);
}

.plan-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.plan-card.sold-out {
    opacity: 0.6;
    filter: grayscale(0.5);
    pointer-events: none;
}

.sold-out-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    background: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 1.2rem;
    z-index: 10;
    border: 3px solid white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    white-space: nowrap;
}

.plan-card.sold-out .plan-price, .plan-card.sold-out h3 {
    text-decoration: line-through;
}

.plan-image img {
    height: 60px;
    width: auto;
    border-radius: 8px;
    object-fit: contain;
}

.plan-price {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0.5rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

.old-price {
    font-size: 1.1rem;
    color: #999 !important;
    text-decoration: line-through !important;
    font-weight: 500;
    margin-bottom: -5px;
    display: block;
}

.new-price {
    color: var(--success-color);
}

/* Desktop Styles */
@media (min-width: 768px) {
    .navbar {
        flex-direction: row;
        justify-content: space-between;
        padding: 1rem 2rem;
    }

    .nav-links {
        gap: 2rem;
    }

    .container {
        margin: 2rem auto;
    }

    .plans-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .card {
        padding: 2rem;
    }
}

/* Error/Success Messages */
.error {
    background-color: #fce8e8;
    color: var(--error-color);
    border: 1px solid #f8caca;
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    text-align: center;
    font-weight: 500;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* QR Code Display */
.qr-container {
    text-align: center;
    margin: 1.5rem 0;
}

.qr-container img {
    max-width: 100%;
    height: auto;
    width: 250px;
    border: 8px solid #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Page Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 1.0); /* Full white to hide content while loading */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.4s ease-out, visibility 0.4s;
}

#loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #e1e4e8;
    border-top: 6px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Page Fade-in Animation */
.page-fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}
