/**
 * Lotus Misqal - Desktop Styles (iOS-inspired Dark Theme)
 */

:root {
    --bg-primary: #000000;
    --bg-secondary: #1c1c1e;
    --bg-tertiary: #2c2c2e;
    --bg-card: #1c1c1e;
    
    --text-primary: #ffffff;
    --text-secondary: #98989d;
    --text-tertiary: #636366;
    
    --accent-gold: #ffd700;
    --accent-gold-light: #ffed4e;
    --accent-gold-dark: #b8860b;
    
    --success: #34c759;
    --error: #ff3b30;
    --warning: #ff9500;
    --info: #007aff;
    
    --border-color: #38383a;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    --shadow-large: 0 8px 30px rgba(0, 0, 0, 0.6);
    
    --radius: 16px;
    --radius-small: 8px;
    --radius-large: 24px;
    
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 20px;
    font-weight: 600;
    color: var(--accent-gold);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-menu {
    display: flex;
    gap: 8px;
    list-style: none;
    position: relative;
}

.navbar-menu > li {
    position: relative;
}

.navbar-menu a {
    padding: 10px 18px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-small);
    transition: var(--transition);
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.navbar-menu a:hover,
.navbar-menu a.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-dropdown .nav-dropdown-toggle::after {
    content: '▾';
    font-size: 12px;
    margin-right: 4px;
    transition: transform 0.2s ease;
}

.nav-dropdown.open .nav-dropdown-toggle::after {
    transform: rotate(180deg);
}

.nav-dropdown.open > .nav-dropdown-toggle,
.nav-submenu a:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-submenu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    min-width: 190px;
    padding: 8px;
    list-style: none;
    display: none;
    flex-direction: column;
    box-shadow: var(--shadow);
    z-index: 1001;
}

.nav-submenu li + li {
    margin-top: 4px;
}

.nav-submenu a {
    display: block;
    padding: 10px 12px;
    font-size: 14px;
    border-radius: var(--radius-small);
}

.nav-submenu a.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-dropdown:hover .nav-submenu,
.nav-dropdown.open .nav-submenu {
    display: flex;
}

/* Main Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-large);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Calculation List */
.calc-item {
    background: var(--bg-tertiary);
    border-radius: var(--radius-small);
    padding: 20px;
    margin-bottom: 16px;
    border-left: 4px solid transparent;
    transition: var(--transition);
}

.calc-item:hover {
    background: var(--bg-secondary);
    border-left-color: var(--accent-gold);
    transform: translateX(4px);
}

.calc-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.calc-item-source {
    font-weight: 600;
    color: var(--accent-gold);
    font-size: 16px;
}

.calc-item-time {
    color: var(--text-tertiary);
    font-size: 13px;
}

.calc-item-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.calc-item-details {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px;
    margin-top: 12px;
    width: 100%;
}

.calc-detail {
    display: flex;
    flex-direction: column;
}

.calc-detail-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.calc-detail-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.advice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 12px;
}

.advice.buy {
    background: rgba(52, 199, 89, 0.2);
    color: var(--success);
}

.advice.sell {
    background: rgba(255, 59, 48, 0.2);
    color: var(--error);
}

/* Widgets */
.widget {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.widget-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* TradingView Widgets */
.tradingview-widget-wrapper {
    overflow: hidden;
}

.tradingview-widget-container {
    width: 100%;
    border-radius: var(--radius-small);
    overflow: hidden;
}

.tradingview-widget-container__widget {
    width: 100%;
    height: 100%;
}

.tradingview-widget-copyright {
    text-align: center;
    padding-top: 8px;
}

.tradingview-widget-copyright a {
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 11px;
    transition: var(--transition);
}

.tradingview-widget-copyright a:hover {
    color: var(--accent-gold);
}

.tradingview-widget-copyright .blue-text {
    color: var(--accent-gold);
}

.widget-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-gold);
    margin: 12px 0;
}

.widget-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    color: var(--text-primary);
    font-size: 15px;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-gold);
    background: var(--bg-secondary);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-small);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent-gold);
    color: #000;
}

.btn-primary:hover {
    background: var(--accent-gold-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
}

.btn-full {
    width: 100%;
}

.btn-small {
    padding: 8px 16px !important;
    font-size: 13px !important;
}

.form-input-small {
    width: 120px;
    padding: 8px 12px;
    font-size: 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    color: var(--text-primary);
}

.form-input-small:focus {
    outline: none;
    border-color: var(--accent-gold);
    background: var(--bg-secondary);
}

/* Card Header Inner */
.card-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* Inline Rate Update in Header */
.inline-rate-update {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.inline-rate-update:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.15);
}

.rate-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.rate-value {
    color: var(--accent-gold);
    font-weight: 600;
    font-size: 15px;
}

.rate-update-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

@media (max-width: 768px) {
    .inline-rate-update {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 12px;
        font-size: 13px;
        width: 100%;
        margin-top: 12px;
    }
    
    .rate-label {
        font-size: 13px;
    }
    
    .rate-value {
        font-size: 14px;
    }
    
    .rate-update-form {
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
    }
    
    .form-input-small {
        flex: 1;
        min-width: 100px;
        max-width: 140px;
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .btn-small {
        padding: 6px 14px !important;
        font-size: 12px !important;
        white-space: nowrap;
    }
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: rgba(52, 199, 89, 0.2);
    color: var(--success);
}

.badge-danger {
    background: rgba(255, 59, 48, 0.2);
    color: var(--error);
}

.badge-warning {
    background: rgba(255, 149, 0, 0.2);
    color: var(--warning);
}

.badge-info {
    background: rgba(0, 122, 255, 0.2);
    color: var(--info);
}

/* Notifications */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px 20px;
    min-width: 300px;
    box-shadow: var(--shadow-large);
    z-index: 9999;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    border-left: 4px solid var(--success);
}

.notification.error {
    border-left: 4px solid var(--error);
}

.notification.info {
    border-left: 4px solid var(--info);
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--bg-tertiary);
    border-top: 3px solid var(--accent-gold);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-color);
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-gold {
    color: var(--accent-gold);
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

