/**
 * Crypto Trading Calculator - Main Stylesheet
 * Dark mode Binance-inspired professional trading dashboard
 */

:root {
    /* Color Variables */
    --ctc-bg-primary: #0f0f23;
    --ctc-bg-secondary: #16213e;
    --ctc-bg-tertiary: #1a2332;
    --ctc-bg-card: rgba(22, 33, 62, 0.8);
    --ctc-border-color: rgba(255, 255, 255, 0.1);
    --ctc-text-primary: #ffffff;
    --ctc-text-secondary: #a0a9c9;
    --ctc-text-muted: #6b7280;
    --ctc-accent-primary: #0d6efd;
    --ctc-accent-secondary: #f0ad4e;
    --ctc-success-color: #28a745;
    --ctc-danger-color: #dc3545;
    --ctc-warning-color: #ffc107;
    --ctc-info-color: #17a2b8;
    
    /* Glassmorphism Effect */
    --ctc-glass-blur: blur(10px);
    --ctc-glass-opacity: 0.7;
}

/* ============================================
   GLOBAL STYLES
   ============================================ */

.ctc-calculator-wrapper {
    background: linear-gradient(135deg, #0f0f23 0%, #16213e 100%);
    color: var(--ctc-text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    padding: 30px 0;
    position: relative;
    overflow: hidden;
}

.ctc-calculator-wrapper::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(13, 110, 253, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(255, 193, 7, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.ctc-container {
    max-width: 1400px;
    position: relative;
    z-index: 1;
}

/* ============================================
   HEADER SECTION
   ============================================ */

.ctc-header {
    text-align: center;
    margin-bottom: 50px;
    padding: 40px 20px;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(255, 193, 7, 0.05) 100%);
    border-radius: 20px;
    border: 1px solid var(--ctc-border-color);
    backdrop-filter: var(--ctc-glass-blur);
}

.ctc-header-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #0d6efd 0%, #f0ad4e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ctc-title {
    margin-bottom: 10px;
}

.ctc-title i {
    margin-right: 15px;
}

.ctc-subtitle {
    color: var(--ctc-text-secondary);
    font-size: 1.1rem;
    margin: 0;
}

/* ============================================
   FORM CARD STYLES
   ============================================ */

.ctc-form-card {
    background: var(--ctc-bg-card);
    border: 1px solid var(--ctc-border-color);
    border-radius: 15px;
    overflow: hidden;
    backdrop-filter: var(--ctc-glass-blur);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ctc-form-header {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.15) 0%, rgba(240, 173, 78, 0.1) 100%);
    padding: 20px;
    border-bottom: 1px solid var(--ctc-border-color);
}

.ctc-form-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    color: var(--ctc-text-primary);
}

.ctc-form-title i {
    margin-right: 10px;
    color: var(--ctc-accent-primary);
}

.ctc-form-body {
    padding: 25px;
    flex: 1;
    overflow-y: auto;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.ctc-form-group {
    margin-bottom: 20px;
}

.ctc-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ctc-text-primary);
}

.ctc-label i {
    margin-right: 6px;
}

.ctc-input,
.ctc-select {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--ctc-border-color);
    border-radius: 8px;
    color: var(--ctc-text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.ctc-input:focus,
.ctc-select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--ctc-accent-primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
}

.ctc-input::placeholder {
    color: var(--ctc-text-muted);
}

.ctc-input-group {
    display: flex;
    align-items: center;
    position: relative;
}

.ctc-input-group .ctc-input {
    padding-right: 50px;
}

.ctc-currency-badge {
    position: absolute;
    right: 12px;
    background: linear-gradient(135deg, var(--ctc-accent-primary), var(--ctc-accent-secondary));
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
}

/* ============================================
   BUTTON GROUP STYLES
   ============================================ */

.ctc-button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ctc-radio-input {
    display: none;
}

.ctc-radio-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--ctc-border-color);
    border-radius: 8px;
    cursor: pointer;
    color: var(--ctc-text-secondary);
    font-weight: 600;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
}

.ctc-radio-label:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--ctc-accent-primary);
}

.ctc-radio-input:checked + .ctc-radio-label {
    background: linear-gradient(135deg, var(--ctc-accent-primary), var(--ctc-accent-secondary));
    border-color: var(--ctc-accent-primary);
    color: white;
    box-shadow: 0 0 15px rgba(13, 110, 253, 0.4);
}

/* ============================================
   LEVERAGE SLIDER
   ============================================ */

.ctc-leverage-slider {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ctc-range-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--ctc-accent-primary), var(--ctc-accent-secondary));
    outline: none;
    -webkit-appearance: none;
}

.ctc-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ctc-accent-primary), var(--ctc-accent-secondary));
    cursor: pointer;
    box-shadow: 0 0 10px rgba(13, 110, 253, 0.5);
}

.ctc-range-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ctc-accent-primary), var(--ctc-accent-secondary));
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(13, 110, 253, 0.5);
}

.ctc-leverage-value {
    min-width: 70px;
    text-align: right;
    font-weight: 700;
    color: var(--ctc-accent-primary);
    font-size: 1.2rem;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */

.ctc-button-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 30px;
}

.ctc-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ctc-btn-primary {
    background: linear-gradient(135deg, var(--ctc-accent-primary), #0056cc);
    color: white;
    grid-column: 1 / -1;
    padding: 14px 20px;
    font-size: 1rem;
}

.ctc-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(13, 110, 253, 0.4);
}

.ctc-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--ctc-text-secondary);
    border: 1px solid var(--ctc-border-color);
}

.ctc-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--ctc-accent-primary);
    color: var(--ctc-accent-primary);
}

.ctc-btn-info {
    background: rgba(23, 162, 184, 0.2);
    color: #17a2b8;
    border: 1px solid #17a2b8;
}

.ctc-btn-info:hover {
    background: rgba(23, 162, 184, 0.3);
}

/* ============================================
   RESULT CARDS
   ============================================ */

.ctc-result-card {
    background: var(--ctc-bg-card);
    border: 1px solid var(--ctc-border-color);
    border-radius: 15px;
    overflow: hidden;
    backdrop-filter: var(--ctc-glass-blur);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.ctc-result-card:hover {
    border-color: rgba(13, 110, 253, 0.3);
    box-shadow: 0 12px 40px rgba(13, 110, 253, 0.2);
}

.ctc-result-header {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.15) 0%, rgba(240, 173, 78, 0.1) 100%);
    padding: 15px 20px;
    border-bottom: 1px solid var(--ctc-border-color);
}

.ctc-result-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--ctc-text-primary);
}

.ctc-result-title i {
    margin-right: 8px;
    color: var(--ctc-accent-primary);
}

.ctc-result-body {
    padding: 20px;
}

.ctc-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ctc-result-row:last-child {
    border-bottom: none;
}

.ctc-result-row.ctc-result-total {
    border-top: 1px solid var(--ctc-border-color);
    border-bottom: none;
    padding-top: 15px;
    margin-top: 10px;
    font-weight: 600;
}

.ctc-result-label {
    color: var(--ctc-text-secondary);
    font-size: 0.95rem;
}

.ctc-result-value {
    color: var(--ctc-text-primary);
    font-weight: 600;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
}

.ctc-result-value.ctc-highlight {
    font-size: 1.2rem;
    padding: 8px 12px;
    background: rgba(13, 110, 253, 0.1);
    border-radius: 6px;
}

/* ============================================
   PROFIT/LOSS COLORING
   ============================================ */

.ctc-positive {
    color: var(--ctc-success-color) !important;
}

.ctc-negative {
    color: var(--ctc-danger-color) !important;
}

.ctc-neutral {
    color: var(--ctc-text-secondary) !important;
}

/* ============================================
   DISCLAIMER SECTION
   ============================================ */

.ctc-disclaimer {
    margin-top: 40px;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(255, 193, 7, 0.1) 100%);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.ctc-disclaimer-icon {
    font-size: 1.5rem;
    color: var(--ctc-warning-color);
    flex-shrink: 0;
}

.ctc-disclaimer-content h4 {
    margin: 0 0 10px 0;
    color: var(--ctc-warning-color);
    font-weight: 700;
}

.ctc-disclaimer-content p {
    margin: 0;
    color: var(--ctc-text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 992px) {
    .ctc-main-section .row {
        flex-direction: column-reverse;
    }

    .ctc-header-content h1 {
        font-size: 2rem;
    }

    .ctc-form-card {
        margin-top: 30px;
    }

    .ctc-button-container {
        grid-template-columns: 1fr;
    }

    .ctc-btn-primary {
        grid-column: auto;
    }
}

@media (max-width: 768px) {
    .ctc-calculator-wrapper {
        padding: 15px 0;
    }

    .ctc-header {
        margin-bottom: 30px;
        padding: 25px 15px;
    }

    .ctc-header-content h1 {
        font-size: 1.5rem;
    }

    .ctc-subtitle {
        font-size: 0.95rem;
    }

    .ctc-form-card,
    .ctc-result-card {
        border-radius: 12px;
    }

    .ctc-form-body {
        padding: 15px;
    }

    .ctc-result-body {
        padding: 15px;
    }

    .ctc-button-group {
        flex-direction: column;
    }

    .ctc-radio-label {
        flex: 1;
    }

    .ctc-disclaimer {
        flex-direction: column;
        text-align: center;
    }

    .ctc-disclaimer-icon {
        font-size: 1.2rem;
    }

    .ctc-result-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .ctc-result-value {
        margin-top: 8px;
        width: 100%;
        text-align: right;
    }
}

@media (max-width: 576px) {
    .ctc-container {
        padding: 0 10px;
    }

    .ctc-header-content h1 {
        font-size: 1.3rem;
    }

    .ctc-title i,
    .ctc-form-title i,
    .ctc-result-title i {
        display: none;
    }

    .ctc-label {
        font-size: 0.85rem;
    }

    .ctc-input,
    .ctc-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .ctc-button-container {
        gap: 8px;
    }

    .ctc-btn {
        padding: 10px 15px;
        font-size: 0.85rem;
    }

    .ctc-result-value {
        font-size: 0.95rem;
    }

    .ctc-leverage-value {
        min-width: 50px;
        font-size: 1rem;
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

.ctc-form-body::-webkit-scrollbar {
    width: 6px;
}

.ctc-form-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.ctc-form-body::-webkit-scrollbar-thumb {
    background: rgba(13, 110, 253, 0.3);
    border-radius: 3px;
}

.ctc-form-body::-webkit-scrollbar-thumb:hover {
    background: rgba(13, 110, 253, 0.5);
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ctc-result-card {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.ctc-btn-primary:active {
    transform: translateY(0);
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .ctc-calculator-wrapper::before {
        display: none;
    }

    .ctc-button-container,
    .ctc-form-card {
        display: none;
    }

    .ctc-result-card {
        page-break-inside: avoid;
    }
}
