/* ============================================================================
   AIRTIMEXCHANGE SHOP - WHITE TABS WITH BLUE UNDERLINE
   ============================================================================ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #007bff;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* ============================================================================
   HEADER - BLUE WITH VISIBLE HAMBURGER MENU
   ============================================================================ */
header {
    background-color: #007bff;
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
}

header h1 {
    margin: 0;
    font-size: 1.5em;
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* HAMBURGER MENU - VISIBLE ON LEFT */
.hamburger-menu {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 24px;
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 100;
    background: transparent;
    border: none;
    padding: 0;
}

.hamburger-menu .bar {
    width: 100%;
    height: 3px;
    background-color: white !important;
    border-radius: 2px;
    transition: all 0.3s ease;
    display: block;
}

.hamburger-menu:hover .bar {
    background-color: rgba(255, 255, 255, 0.8) !important;
}

.hamburger-menu:active .bar {
    background-color: rgba(255, 255, 255, 0.6) !important;
}

/* ============================================================================
   PWA INSTALL BUTTON - FIXED AT TOP RIGHT
   ============================================================================ */
.pwa-install-button,
button#install-btn {
    position: fixed !important;
    top: 15px !important;
    right: 15px !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    background: #28a745 !important;
    color: white !important;
    border: none !important;
    padding: 0 !important;
    font-size: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 99999 !important;
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.4) !important;
    transition: all 0.3s ease !important;
    margin: 0 !important;
}

.pwa-install-button:hover,
button#install-btn:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.5) !important;
}

.pwa-install-button:active,
button#install-btn:active {
    transform: scale(0.95) !important;
}

/* iOS Install Hint */
#ios-install-hint {
    position: fixed;
    top: 65px;
    right: 15px;
    background: #fff;
    color: #000;
    padding: 12px 16px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 9998;
    font-size: 13px;
    line-height: 1.4;
    max-width: 280px;
    text-align: left;
    border: 1px solid #e0e0e0;
}

/* ============================================================================
   SIDEBAR
   ============================================================================ */
#sidebar {
    position: fixed;
    top: 0;
    left: -260px;
    width: 260px;
    height: 100%;
    background-color: #ffffff;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    z-index: 10000;
    padding-top: 60px;
}

#sidebar.open {
    left: 0;
}

#sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#sidebar ul li {
    padding: 0;
    border-bottom: 1px solid #f0f0f0;
}

#sidebar ul li a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    display: block;
    padding: 18px 25px;
    transition: all 0.2s;
}

#sidebar ul li a:hover {
    background: #f8f9fa;
    color: #007bff;
    padding-left: 30px;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.8em;
    cursor: pointer;
    color: #007bff;
    user-select: none;
    background: none;
    border: none;
    padding: 5px 10px;
    transition: opacity 0.2s;
}

.close-btn:hover {
    opacity: 0.7;
}

#overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

/* ============================================================================
   MAIN CONTENT
   ============================================================================ */
main {
    padding: 0;
    max-width: 800px;
    margin: 0 auto;
    background: white;
    min-height: calc(100vh - 200px);
}

/* ============================================================================
   TABS - WHITE BACKGROUND WITH BLUE UNDERLINE ONLY
   ============================================================================ */
.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 15px;
}

.tab {
    flex: 1;
    padding: 16px 15px;
    background: white;
    color: #6c757d;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    text-transform: capitalize;
    margin: 0 2px;
    border-radius: 8px 8px 0 0;
}

.tab.active {
    color: #007bff;
    background: white;
    border-bottom-color: #007bff;
}

.tab:hover {
    color: #495057;
    background: white;
}

.tab-section {
    display: none;
}

.tab-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

section {
    background: #ffffff;
    padding: 30px 25px 50px 25px;
    margin-bottom: 0;
}

/* ============================================================================
   FORM ELEMENTS
   ============================================================================ */
label {
    display: block;
    margin-top: 20px;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 15px;
}

label:first-child {
    margin-top: 0;
}

select, input {
    width: 100%;
    padding: 14px 16px;
    margin-top: 0;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s;
    background: #fff;
}

select:focus, input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

input::placeholder {
    color: #adb5bd;
}

.note {
    font-size: 13px;
    color: #6c757d;
    margin-top: 6px;
    font-style: italic;
}

.notice {
    font-size: 14px;
    margin-top: 8px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    display: inline-block;
}

.notice.good {
    color: #28a745;
    background: #d4edda;
}

.notice.warn {
    color: #fd7e14;
    background: #fff3cd;
}

/* Buttons */
button:not(.hamburger-menu):not(.close-btn):not(.pwa-install-button):not(#install-btn):not(.tab) {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 16px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 17px;
    width: 100%;
    margin-top: 25px;
    transition: all 0.3s;
    font-family: inherit;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,123,255,0.2);
}

button:not(.hamburger-menu):not(.close-btn):not(.pwa-install-button):not(#install-btn):not(.tab):hover {
    background-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

button:not(.hamburger-menu):not(.close-btn):not(.pwa-install-button):not(#install-btn):not(.tab):active {
    transform: translateY(0);
}

button:not(.hamburger-menu):not(.close-btn):not(.pwa-install-button):not(#install-btn):not(.tab):disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============================================================================
   FOOTER - NO BLUE BAR
   ============================================================================ */
footer {
    background-color: #ffffff !important;
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid #e9ecef;
    margin-top: 0;
    width: 100%;
    position: relative;
}

.contact-card {
    max-width: 500px;
    margin: 0 auto;
    background: #ffffff !important;
    padding: 25px;
}

.contact-card h3 {
    margin-top: 0;
    color: #333;
    margin-bottom: 20px;
    font-size: 1.4em;
    font-weight: 600;
}

.contact-card p {
    margin: 12px 0;
    line-height: 1.8;
    color: #495057;
    font-size: 15px;
}

.social-links {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.social-links a {
    margin: 0 12px;
    text-decoration: none;
    color: #007bff;
    font-weight: 500;
    transition: color 0.2s;
}

.social-links a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* ============================================================================
   MODAL
   ============================================================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 20000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 35px;
    animation: slideUp 0.3s ease;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.success-icon, .error-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 20px;
}

.success-icon {
    background: #28a745;
    color: white;
}

.error-icon {
    background: #dc3545;
    color: white;
}

.result-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

.result-message {
    font-size: 15px;
    color: #6c757d;
    text-align: center;
    margin-bottom: 10px;
    line-height: 1.6;
}

.btn-ok {
    margin-top: 25px;
    background-color: #007bff !important;
    width: 100%;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 768px) {
    header h1 { font-size: 1.3em; }
    header { padding: 14px 18px; }
    .hamburger-menu { left: 18px; width: 28px; height: 22px; }
    .hamburger-menu .bar { height: 2.5px; }
    section { padding: 25px 20px 40px 20px; }
    .tab { font-size: 14px; padding: 14px 10px; }
    main { max-width: 100%; }
    .tabs { padding: 0 10px; }
    .pwa-install-button, button#install-btn {
        width: 40px !important;
        height: 40px !important;
        font-size: 18px !important;
        top: 12px !important;
        right: 12px !important;
    }
}

@media (max-width: 480px) {
    header h1 { font-size: 1.2em; }
    header { padding: 12px 15px; }
    .hamburger-menu { left: 15px; width: 26px; height: 20px; }
    .hamburger-menu .bar { height: 2.5px; }
    section { padding: 20px 15px 35px 15px; }
    .contact-card { padding: 20px; }
    .tab { font-size: 13px; padding: 12px 8px; }
    .tabs { padding: 0 8px; }
    .pwa-install-button, button#install-btn {
        width: 38px !important;
        height: 38px !important;
        font-size: 16px !important;
        top: 10px !important;
        right: 10px !important;
    }
}

@media (max-width: 360px) {
    header h1 { font-size: 1.1em; }
    .hamburger-menu { left: 12px; width: 24px; height: 18px; }
    .hamburger-menu .bar { height: 2px; }
    .tab { font-size: 12px; padding: 10px 5px; }
    .tabs { padding: 0 5px; }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* Print Styles */
@media print {
    header, footer, #sidebar, #overlay, .pwa-install-button, button#install-btn, #ios-install-hint {
        display: none !important;
    }
}
