/**
 * CryptoExchange - Professional Frontend Styles
 */

/* === Reset & Base === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --bg-input: #0f172a;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --border-light: #475569;
    --gradient-1: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
    --gradient-2: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary);
}

/* === Header === */
.header {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.75rem 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
}

.logo i {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.75rem;
}

.nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: var(--bg-card);
}

/* === Hero === */
.hero {
    position: relative;
    padding: 4rem 0 2rem;
    text-align: center;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.gradient-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.hero-bg-shapes {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.05;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    right: -100px;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--accent);
    bottom: -50px;
    left: -50px;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: var(--primary-light);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* === Exchange Section === */
.exchange-section {
    padding: 2rem 0 4rem;
}

.exchange-card {
    max-width: 560px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-xl);
}

.exchange-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.exchange-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.exchange-header h2 i {
    color: var(--primary-light);
    margin-right: 0.5rem;
}

.rate-badge {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.exchange-row {
    margin-bottom: 1.25rem;
}

.exchange-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.optional-tag {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.exchange-input-group {
    display: flex;
    gap: 0;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

.exchange-input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.exchange-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.85rem 1rem;
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    outline: none;
    min-width: 0;
}

.exchange-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.receive-input {
    color: var(--success);
}

.currency-select-wrapper {
    display: flex;
    align-items: center;
    border-left: 1px solid var(--border);
}

.currency-select {
    background: var(--bg-card);
    border: none;
    color: var(--text-primary);
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    outline: none;
    min-width: 140px;
    appearance: auto;
}

.currency-select option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0.5rem;
}

.exchange-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    min-height: 1.2em;
}

/* Swap Button */
.swap-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.75rem 0;
}

.swap-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gradient-1);
    border: 3px solid var(--bg-card);
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    transition: var(--transition);
    flex-shrink: 0;
}

.swap-btn:hover {
    transform: rotate(180deg);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.rate-display {
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex: 1;
}

.rate-display .rate-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* Address Input */
.address-input-group {
    position: relative;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.address-input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.address-icon {
    color: var(--text-muted);
    padding-left: 1rem;
    font-size: 0.9rem;
}

.address-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.85rem 1rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Inter', monospace;
    outline: none;
}

.address-input::placeholder {
    font-family: 'Inter', sans-serif;
}

/* Summary */
.exchange-summary {
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.summary-row.highlight {
    border-top: 1px solid rgba(99, 102, 241, 0.15);
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    color: var(--success);
    font-size: 1rem;
}

.text-bold {
    font-weight: 700;
    color: var(--text-primary);
}

.summary-row.highlight .text-bold {
    color: var(--success);
}

/* Exchange Button */
.exchange-btn {
    width: 100%;
    padding: 1rem;
    background: var(--gradient-1);
    border: none;
    border-radius: var(--radius);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.exchange-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.exchange-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.exchange-footer {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.exchange-footer i {
    color: var(--success);
}

/* === How It Works === */
.how-section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 3rem;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    position: relative;
    transition: var(--transition);
}

.step-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.step-number {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
}

.step-icon {
    font-size: 2.5rem;
    margin: 1rem 0;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.step-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.step-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* === Features === */
.features-section {
    padding: 2rem 0 4rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    border-color: var(--primary);
}

.feature-card i {
    font-size: 2rem;
    color: var(--primary-light);
    margin-bottom: 0.75rem;
}

.feature-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* === Order Page === */
.order-section {
    padding: 3rem 0;
}

.order-card {
    max-width: 700px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-xl);
}

.order-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.order-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
}

.order-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}

.status-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.status-info {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.status-primary {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

.status-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.status-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.status-secondary {
    background: rgba(100, 116, 139, 0.15);
    color: #94a3b8;
}

/* Progress Steps */
.order-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
    padding: 1.5rem 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.step-circle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--bg-input);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.progress-step.active .step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.progress-step.current .step-circle {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0.1); }
}

.progress-step span {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-step.active span {
    color: var(--primary-light);
}

.progress-line {
    width: 40px;
    height: 2px;
    background: var(--border);
    margin: 0 0.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.progress-line.active {
    background: var(--primary);
}

/* Deposit Box */
.deposit-box {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.deposit-box h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--success);
}

.deposit-box p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.address-box {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.address-box code {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    word-break: break-all;
    flex: 1;
}

.copy-btn {
    background: var(--primary);
    border: none;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.copy-btn:hover {
    background: var(--primary-dark);
}

.timer-box {
    text-align: center;
    font-size: 0.9rem;
    color: var(--warning);
    font-weight: 600;
}

/* Order Details */
.order-details {
    margin-bottom: 1.5rem;
}

.order-details h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.detail-item {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
}

.detail-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-weight: 600;
    font-size: 0.9rem;
}

.detail-value.small-text {
    font-size: 0.75rem;
    word-break: break-all;
    font-family: monospace;
}

.text-green {
    color: var(--success);
}

.order-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.order-footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

/* === Track Page === */
.track-section {
    padding: 4rem 0;
}

.track-card {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
}

.track-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.track-subtitle {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.track-input-group {
    display: flex;
    gap: 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.track-input {
    flex: 1;
    background: var(--bg-input);
    border: none;
    padding: 0.85rem 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Inter', monospace;
    outline: none;
}

.track-input::placeholder {
    font-family: 'Inter', sans-serif;
    color: var(--text-muted);
}

.track-btn {
    background: var(--gradient-1);
    border: none;
    color: white;
    padding: 0.85rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}

.track-btn:hover {
    opacity: 0.9;
}

.track-result {
    margin-top: 2rem;
    text-align: left;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.track-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.track-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.track-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.track-detail-row span:first-child {
    color: var(--text-muted);
}

/* === Alerts === */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    max-width: 600px;
    margin: 2rem auto;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
}

.btn-primary:hover {
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary-light);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.82rem;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

/* === Footer === */
.footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 2rem;
}

.footer-inner {
    text-align: center;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.footer-logo i {
    color: var(--primary-light);
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* === Responsive === */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 0.75rem;
    }

    .exchange-card {
        padding: 1.5rem;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .order-progress {
        flex-wrap: wrap;
    }

    .progress-line {
        width: 25px;
    }

    .track-input-group {
        flex-direction: column;
    }

    .track-btn {
        border-radius: 0;
    }
}

@media (max-width: 480px) {
    .exchange-input-group {
        flex-direction: column;
    }

    .currency-select-wrapper {
        border-left: none;
        border-top: 1px solid var(--border);
    }

    .currency-select {
        width: 100%;
    }

    .swap-row {
        flex-direction: column;
    }
}
