/* ========================================
   GAMT™ APP BASE STYLES
   Unified design language with www site
   GAMT™ Blue Theme: #4A90E2
   ======================================== */

/* ========================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ======================================== */
:root {
    /* GAMT™ Brand Colors */
    --primary-color: #4A90E2;
    --primary-dark: #357ABD;
    --primary-light: #5BA3F5;
    --primary-gradient: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);

    /* Neutral Colors */
    --bg-white: #ffffff;
    --bg-subtle: #f8f9fa;
    --bg-light: #f0f7ff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-tertiary: #888888;

    /* Border Colors */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;

    /* Status Colors */
    --success-bg: #d4edda;
    --success-color: #155724;
    --success-border: #c3e6cb;
    --error-bg: #f8d7da;
    --error-color: #721c24;
    --error-border: #f5c6cb;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.15);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;

    /* Spacing */
    --navbar-height: 60px;
    --container-padding: 20px;
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    background: var(--bg-light);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: var(--navbar-height);
    position: relative;
}

/* ========================================
   BACKGROUND WATERMARK
   ======================================== */
.background-logo {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.05;
    width: 400px;
    height: 400px;
    z-index: 0;
    pointer-events: none;
}

.background-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ========================================
   APP NAVIGATION
   ======================================== */
.app-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.navbar-container {
    max-width: 100%;
    height: 100%;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo */
.navbar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 18px;
    transition: var(--transition-fast);
}

.navbar-logo:hover {
    color: var(--primary-color);
}

.navbar-logo img {
    height: 40px;
    width: auto;
}

.navbar-logo .logo-text sup {
    font-size: 0.5em;
    vertical-align: super;
}

/* Profile Icon */
.profile-icon {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.profile-icon:hover {
    color: var(--primary-color);
    background: var(--bg-light);
}

/* Hamburger Menu Button */
.navbar-burger {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.navbar-burger:hover {
    background: var(--bg-subtle);
}

.navbar-burger span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition-fast);
}

/* Hamburger Animation - X Formation */
.navbar-burger.is-active span:nth-child(1) {
    transform: rotate(45deg);
    position: absolute;
    top: 50%;
}

.navbar-burger.is-active span:nth-child(2) {
    opacity: 0;
}

.navbar-burger.is-active span:nth-child(3) {
    transform: rotate(-45deg);
    position: absolute;
    top: 50%;
}

/* Mobile Menu Dropdown */
.navbar-menu {
    position: fixed;
    top: var(--navbar-height);
    right: -300px;
    width: 280px;
    max-height: calc(100vh - var(--navbar-height));
    background: var(--bg-white);
    box-shadow: var(--shadow-lg);
    border-left: 1px solid var(--border-light);
    overflow-y: auto;
    transition: right var(--transition-medium);
    z-index: 999;
}

.navbar-menu.is-active {
    right: 0;
}

.navbar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-light);
    min-height: 52px;
    transition: var(--transition-fast);
    font-size: 15px;
    font-weight: 500;
}

.navbar-item:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.navbar-item svg {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.navbar-item:hover svg {
    color: var(--primary-color);
}

/* Upgrade Item (Special Styling) */
.navbar-item-upgrade {
    color: var(--primary-color);
    font-weight: 600;
}

.navbar-item-upgrade svg {
    color: var(--primary-color);
}

/* Logout Item (Special Styling) */
.navbar-item-logout {
    color: #dc3545;
}

.navbar-item-logout:hover {
    background: #fff0f0;
    color: #b00020;
}

.navbar-item-logout svg {
    color: #dc3545;
}

/* ========================================
   MAIN CONTENT AREA
   ======================================== */
.main-content {
    position: relative;
    z-index: 1;
    min-height: calc(100vh - var(--navbar-height) - 100px);
    padding: var(--container-padding);
}

/* ========================================
   CARDS & CONTAINERS
   ======================================== */
.card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(74, 144, 226, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(74, 144, 226, 0.1);
    transition: var(--transition-medium);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(74, 144, 226, 0.15);
    border-color: rgba(74, 144, 226, 0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    min-height: 48px;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.btn-secondary {
    background: var(--bg-subtle);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
    background: var(--border-light);
}

.btn-danger {
    background: #fff0f0;
    color: #b00020;
    border: 1px solid #f55;
}

.btn-danger:hover {
    background: #ffe6e6;
}

/* ========================================
   ALERTS & MESSAGES
   ======================================== */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin: 20px auto;
    max-width: 600px;
    font-weight: 500;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideDown 0.3s ease;
}

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

.alert-success {
    background: var(--success-bg);
    color: var(--success-color);
    border: 1px solid var(--success-border);
}

.alert-error {
    background: var(--error-bg);
    color: var(--error-color);
    border: 1px solid var(--error-border);
}

.alert-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    transition: var(--transition-fast);
}

.alert-close:hover {
    opacity: 1;
}

/* ========================================
   FOOTER
   ======================================== */
.app-footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-tertiary);
    font-size: 13px;
    line-height: 1.6;
    border-top: 1px solid var(--border-light);
    background: var(--bg-subtle);
    margin-top: 60px;
}

.app-footer .container {
    max-width: 1200px;
    margin: 0 auto;
}

.app-footer p {
    margin: 0 0 12px 0;
}

.app-footer sup {
    font-size: 0.7em;
    vertical-align: super;
}

.footer-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-nav a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-nav a:hover {
    text-decoration: underline;
}

.footer-separator {
    color: var(--text-tertiary);
    opacity: 0.5;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-input:disabled {
    background: var(--bg-subtle);
    color: var(--text-tertiary);
    cursor: not-allowed;
}

/* ========================================
   RESPONSIVE DESIGN - MOBILE
   ======================================== */
@media (max-width: 768px) {
    :root {
        --navbar-height: 56px;
        --container-padding: 16px;
    }

    body {
        padding-top: var(--navbar-height);
    }

    .navbar-logo img {
        height: 36px;
    }

    .navbar-logo .logo-text {
        font-size: 16px;
    }

    .profile-icon {
        right: 60px;
        width: 40px;
        height: 40px;
    }

    .navbar-burger {
        width: 40px;
        height: 40px;
    }

    .navbar-menu {
        width: 100%;
        right: -100%;
    }

    .background-logo {
        width: 300px;
        height: 300px;
    }

    .main-content {
        padding: 12px;
    }

    .card {
        padding: 20px;
        border-radius: 12px;
    }

    .card-title {
        font-size: 20px;
    }

    .btn {
        padding: 12px 24px;
        font-size: 15px;
        width: 100%;
    }

    .app-footer {
        padding: 24px 16px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    :root {
        --navbar-height: 52px;
    }

    .navbar-logo img {
        height: 32px;
    }

    .navbar-logo .logo-text {
        display: none;
    }

    .main-content {
        padding: 10px;
    }

    .card {
        padding: 16px;
        border-radius: 10px;
    }

    .card-title {
        font-size: 18px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media (max-width: 360px) {
    .navbar-logo img {
        height: 28px;
    }

    .profile-icon {
        right: 52px;
        width: 36px;
        height: 36px;
    }

    .navbar-burger {
        width: 36px;
        height: 36px;
        gap: 5px;
    }

    .navbar-burger span {
        width: 20px;
        height: 2px;
    }

    .main-content {
        padding: 8px;
    }

    .card {
        padding: 14px;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.text-center {
    text-align: center;
}

.text-primary {
    color: var(--primary-color);
}

.text-secondary {
    color: var(--text-secondary);
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.hidden {
    display: none;
}

.visible {
    display: block;
}
