/**
 * CRYPTO TEK AI - WEB RESPONSIVE CSS
 * Additional styles for web version with full responsive design
 */

/* ============================
   WEB-SPECIFIC LAYOUT
   ============================ */

/* Root variables */
:root {
    --sidebar-width: 280px;
    --topbar-height: 60px;
    --bottomnav-height: 70px;
    --max-content-width: 1400px;
}

/* Body - Full viewport */
body {
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================
   TOP BAR ENHANCEMENTS
   ============================ */

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Theme Toggle */
.theme-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.theme-toggle i {
    font-size: 18px;
    color: var(--text-muted);
}

/* User Menu */
.user-menu {
    position: relative;
    cursor: pointer;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: border-color 0.3s ease;
}

.user-avatar:hover {
    border-color: var(--primary-color);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    z-index: 1001;
}

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

.user-info {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.user-info span:first-child {
    font-weight: 600;
    color: var(--text-primary);
}

.user-package-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.user-package-badge.free {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
}

.user-package-badge.pro {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.user-package-badge.premium {
    background: rgba(255, 107, 53, 0.2);
    color: var(--primary-color);
}

.user-package-badge.trial {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--text-muted);
}

.dropdown-item.logout {
    color: #ef4444;
}

.dropdown-item.logout i {
    color: #ef4444;
}

/* ============================
   APP CONTAINER
   ============================ */

.app-container {
    padding-top: var(--topbar-height);
    padding-bottom: var(--bottomnav-height);
    min-height: 100vh;
}

/* Page Content */
.page-content {
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

/* ============================
   BOTTOM NAVIGATION
   ============================ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottomnav-height);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.nav-item {
    flex: 1;
    max-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    background: rgba(255, 107, 53, 0.15);
}

.nav-item.active i,
.nav-item.active span {
    color: var(--primary-color);
}

.nav-item i {
    font-size: 20px;
    color: var(--text-muted);
}

.nav-item span {
    font-size: 11px;
    color: var(--text-muted);
}

/* ============================
   WEB MAIN BUTTON
   ============================ */

.web-main-button {
    position: fixed;
    bottom: calc(var(--bottomnav-height) + 20px);
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 40px;
    background: var(--primary-color);
    color: white;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
    z-index: 999;
}

.web-main-button:hover {
    background: var(--primary-dark);
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 107, 53, 0.5);
}

.web-main-button.hidden {
    display: none;
}

.web-main-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.web-main-button.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
    display: inline-block;
}

/* ============================
   SIDE MENU ENHANCEMENTS
   ============================ */

.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.side-menu-content {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100%;
    background: var(--bg-secondary);
    padding: 80px 20px 20px;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.side-menu-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.side-menu-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.side-menu-header i {
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.side-menu-header i:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.menu-item i {
    width: 20px;
    text-align: center;
    color: var(--text-muted);
}

.menu-item span {
    font-size: 14px;
    color: var(--text-primary);
}

/* ============================
   DESKTOP RESPONSIVE
   ============================ */

@media (min-width: 768px) {
    .page-content {
        padding: 30px 40px;
    }

    .bottom-nav {
        gap: 12px;
    }

    .nav-item {
        max-width: 120px;
        padding: 10px 15px;
    }

    .nav-item i {
        font-size: 22px;
    }

    .nav-item span {
        font-size: 12px;
    }
}

@media (min-width: 1024px) {
    :root {
        --bottomnav-height: 80px;
        --max-content-width: 1600px;
    }

    .page-content {
        padding: 40px 60px;
        max-width: 100%;
    }

    /* Cards grid layout - Desktop için 2 kolonlu düzen */
    #dashboard-page .card-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
        margin-bottom: 24px;
    }

    /* Full width card'lar için */
    #dashboard-page .card-container .full-width {
        grid-column: 1 / -1;
    }

    /* Wider side menu */
    .side-menu-content {
        width: 320px;
    }

    /* Enhanced nav items */
    .bottom-nav {
        gap: 16px;
    }

    .nav-item {
        max-width: 140px;
        flex-direction: row;
        gap: 8px;
    }

    .nav-item i {
        font-size: 18px;
    }

    .nav-item span {
        font-size: 13px;
    }
}

@media (min-width: 1440px) {
    .page-content {
        padding: 40px 80px;
        max-width: 100%;
    }

    /* 3 column grid for large screens */
    #dashboard-page .card-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1920px) {
    :root {
        --max-content-width: 2000px;
    }

    .page-content {
        padding: 50px 100px;
    }

    /* 4 column grid for ultra-wide screens */
    #dashboard-page .card-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
    }
}

/* ============================
   MOBILE OPTIMIZATIONS
   ============================ */

@media (max-width: 480px) {
    :root {
        --topbar-height: 56px;
        --bottomnav-height: 64px;
    }

    .top-bar {
        padding: 0 15px;
    }

    .top-bar-right {
        gap: 10px;
    }

    .theme-toggle,
    .user-avatar {
        width: 36px;
        height: 36px;
    }

    .page-content {
        padding: 15px;
    }

    .bottom-nav {
        padding: 0 10px;
    }

    .nav-item {
        padding: 6px;
        gap: 2px;
    }

    .nav-item i {
        font-size: 18px;
    }

    .nav-item span {
        font-size: 10px;
    }

    .user-dropdown {
        width: 200px;
    }
}

/* ============================
   CARDS RESPONSIVE
   ============================ */

.card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

@media (min-width: 768px) {
    .card {
        padding: 24px;
        border-radius: 20px;
    }
}

@media (min-width: 1024px) {
    .card {
        padding: 28px;
        margin-bottom: 24px;
    }
}

/* ============================
   TOAST ENHANCEMENTS
   ============================ */

.toast-container {
    position: fixed;
    top: calc(var(--topbar-height) + 20px);
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: 10px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideInRight 0.3s ease;
    max-width: 350px;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================
   MODAL ENHANCEMENTS
   ============================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================
   SCROLLBAR STYLING
   ============================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* ============================
   LIGHT THEME SUPPORT
   ============================ */

body.light-theme {
    background: linear-gradient(180deg, #f5f5f5 0%, #ffffff 100%);
}

body.light-theme .top-bar,
body.light-theme .bottom-nav,
body.light-theme .side-menu-content,
body.light-theme .user-dropdown,
body.light-theme .card,
body.light-theme .modal-content,
body.light-theme .toast {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .theme-toggle i {
    color: #1a1f35;
}

body.light-theme .nav-item i,
body.light-theme .nav-item span,
body.light-theme .menu-item i {
    color: #6b7280;
}

body.light-theme .nav-item.active i,
body.light-theme .nav-item.active span {
    color: var(--primary-color);
}

body.light-theme .text-primary,
body.light-theme h1, body.light-theme h2, body.light-theme h3 {
    color: #1a1f35;
}

body.light-theme .text-muted {
    color: #6b7280;
}

/* ============================
   PRINT STYLES
   ============================ */

@media print {
    .top-bar,
    .bottom-nav,
    .side-menu,
    .toast-container {
        display: none !important;
    }

    .app-container {
        padding: 0;
    }

    .page-content {
        max-width: 100%;
        padding: 0;
    }
}
