/* Custom styles for TRADIFAST app */

/* PWA optimization */
:root {
    --app-height: 100%;
}

html, body {
    overscroll-behavior-y: none; /* Prevent pull-to-refresh */
    touch-action: manipulation; /* Improve touch responsiveness */
    height: 100%;
    height: var(--app-height);
}

/* Improve tap targets for mobile */
.btn, .nav-link, select, input, a {
    min-height: 44px;
    min-width: 44px;
    padding: 0.5rem 1rem;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

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

/* Navigation and layout */
.sidebar {
    min-height: 100vh;
    height: 100%;
}

.content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 60px; /* Space for bottom navbar on mobile */
}

/* Bottom mobile navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--bs-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Dashboard card styles */
.dashboard-card {
    border-radius: 8px;
    border: none;
    transition: transform 0.2s ease-in-out;
}

.dashboard-card:hover {
    transform: translateY(-4px);
}

.stats-card {
    border-left: 4px solid var(--bs-primary);
}

.info-icon {
    font-size: 2rem;
    opacity: 0.7;
}

/* Chart containers */
.chart-container {
    position: relative;
    height: 300px;
}

/* Operation status badges */
.badge-open {
    background-color: var(--bs-info);
}

.badge-closed {
    background-color: var(--bs-dark);
}

.badge-gain {
    background-color: var(--bs-success);
}

.badge-loss {
    background-color: var(--bs-danger);
}

/* Trading form section */
.trading-form-section {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.calculation-box {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 1rem;
}

/* Fix input width on Safari Mobile */
input[type="number"],
input[type="text"],
input[type="email"],
input[type="password"],
select {
    width: 100%;
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

/* Responsive table for mobile */
@media (max-width: 767.98px) {
    .table-responsive-card table {
        border: 0;
    }
    
    .table-responsive-card table thead {
        display: none;
    }
    
    .table-responsive-card table tr {
        margin-bottom: 1rem;
        display: block;
        border-radius: 8px;
        background-color: rgba(0, 0, 0, 0.2);
        padding: 1rem;
    }
    
    .table-responsive-card table td {
        display: block;
        text-align: right;
        border: none;
        position: relative;
        padding-left: 50%;
        white-space: normal;
    }
    
    .table-responsive-card table td::before {
        content: attr(data-label);
        position: absolute;
        left: 1rem;
        font-weight: bold;
        text-align: left;
    }
}

/* Login and registration forms */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    max-width: 450px;
    width: 100%;
    border-radius: 12px;
    background-color: rgba(0, 0, 0, 0.2);
}

.auth-logo {
    margin-bottom: 2rem;
    max-width: 200px;
}

/* Bottom action bar for mobile forms */
.action-bar {
    position: sticky;
    bottom: 0;
    background-color: var(--bs-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
    margin: 0 -1rem -1rem -1rem;
    border-radius: 0 0 12px 12px;
}

/* Toast notifications */
.toast-container {
    z-index: 1100;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.slide-up {
    animation: slideUp 0.4s ease-out;
}
