:root {
    --primary-color: 220 50% 50%;
    --secondary-color: 200 20% 40%;
    --success-color: 142 76% 36%;
    --info-color: 188 94% 65%;
    --warning-color: 45 93% 60%;
    --danger-color: 354 70% 54%;
    --dark-color: 210 11% 15%;
    --light-color: 210 11% 98%;
    --background: 210 11% 98%;
    --surface: 0 0% 100%;
    --text-primary: 210 11% 15%;
    --text-secondary: 210 11% 35%;
    --text-muted: 210 11% 45%;
}

[data-theme="dark"] {
    --background: 210 11% 8%;
    --surface: 210 11% 12%;
    --text-primary: 210 11% 95%;
    --text-secondary: 210 11% 80%;
    --text-muted: 210 11% 65%;
    --dark-color: 210 11% 95%;
    --light-color: 210 11% 8%;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: hsl(var(--background));
    min-height: 100vh;
    color: hsl(var(--text-primary));
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.gradient-bg {
    background: linear-gradient(135deg, hsl(var(--dark-color)) 0%, hsl(220 30% 25%) 100%);
}

[data-theme="dark"] body.gradient-bg {
    background: linear-gradient(135deg, hsl(210 11% 5%) 0%, hsl(220 15% 10%) 100%);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, hsl(var(--dark-color)) 0%, hsl(220 30% 25%) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

[data-theme="dark"] .hero-section {
    background: linear-gradient(135deg, hsl(210 11% 5%) 0%, hsl(220 15% 10%) 100%);
}

.crypto-animation {
    text-align: center;
    padding: 2rem;
}

.crypto-icons {
    font-size: 4rem;
    animation: float 3s ease-in-out infinite;
}

.crypto-icons i {
    margin: 0 1rem;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.crypto-icons i:hover {
    opacity: 1;
    transform: scale(1.1);
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Features Section */
.features-section {
    background: hsl(var(--background));
    padding: 5rem 0;
}

.feature-card {
    background: hsl(var(--surface));
    border-radius: 1rem;
    transition: all 0.3s ease;
    border: 1px solid hsla(var(--secondary-color), 0.2);
    height: 100%;
    box-shadow: 0 4px 15px hsla(var(--dark-color), 0.1);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px hsla(var(--dark-color), 0.15);
}

.feature-card h4 {
    color: hsl(var(--dark-color));
    font-weight: 600;
    margin-bottom: 1rem;
}

.feature-card p {
    color: hsl(var(--text-muted));
    font-weight: 500;
    line-height: 1.6;
}

.feature-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* CTA Section */
.cta-section {
    background: hsl(var(--dark-color));
    color: white;
    padding: 3rem 0;
}

/* Auth Container */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, hsl(var(--dark-color)) 0%, hsl(220 30% 25%) 100%);
}

.auth-card {
    background: hsl(var(--surface));
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: 0 20px 40px hsla(var(--dark-color), 0.2);
    border: 1px solid hsla(var(--secondary-color), 0.15);
}

.auth-card h2 {
    color: hsl(var(--text-primary));
    font-weight: 700;
}

.auth-card p {
    color: hsl(var(--text-muted));
    font-weight: 500;
}

.auth-card .form-label {
    color: hsl(var(--text-primary));
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.auth-card .form-control {
    background: hsl(0 0% 95%);
    border: 2px solid hsla(var(--secondary-color), 0.5);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    color: hsl(var(--text-primary));
    box-shadow: inset 0 1px 3px hsla(var(--dark-color), 0.08);
}

.auth-card .form-control:focus {
    background: hsl(0 0% 100%);
    border-color: hsl(var(--primary-color));
    box-shadow: 0 0 0 0.15rem hsla(var(--primary-color), 0.15), inset 0 1px 3px hsla(var(--dark-color), 0.08);
    color: hsl(var(--text-primary));
}

[data-theme="dark"] .auth-card .form-control {
    background: hsl(210 11% 18%);
    border-color: hsla(var(--secondary-color), 0.5);
    color: hsl(var(--text-primary));
}

[data-theme="dark"] .auth-card .form-control:focus {
    background: hsl(210 11% 22%);
    border-color: hsl(var(--primary-color));
    color: hsl(var(--text-primary));
}

.auth-card .form-control::placeholder {
    color: hsl(var(--text-muted));
    opacity: 0.7;
}

.input-group-text {
    background: hsla(var(--primary-color), 0.08);
    border: 2px solid hsla(var(--secondary-color), 0.3);
    color: hsl(var(--primary-color));
    font-weight: 600;
}

/* Dashboard Styles */
.stat-card {
    border: none;
    border-radius: 1rem;
    transition: all 0.3s ease;
    background: hsl(var(--surface));
    box-shadow: 0 2px 10px hsla(var(--dark-color), 0.08);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px hsla(var(--dark-color), 0.12);
}

.stat-card .card-title {
    color: hsl(var(--text-primary)) !important;
    font-weight: 600;
}

.stat-card .card-text {
    color: hsl(var(--text-primary)) !important;
    font-weight: 500;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 2px 10px hsla(var(--dark-color), 0.08);
    background: hsl(var(--surface));
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 5px 20px hsla(var(--dark-color), 0.12);
}

.card-header {
    background: hsla(var(--primary-color), 0.08);
    border-bottom: 1px solid hsla(var(--secondary-color), 0.15);
    border-radius: 1rem 1rem 0 0 !important;
    font-weight: 600;
    color: hsl(var(--text-primary));
}

.card-body {
    color: hsl(var(--text-primary));
}

.card-title {
    color: hsl(var(--text-primary)) !important;
}

.card-text {
    color: hsl(var(--text-secondary)) !important;
}

/* Button Styles */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
}

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

.btn-primary:hover {
    background: hsl(var(--primary-color) / 0.8);
    transform: translateY(-1px);
}

.btn-success {
    background: hsl(var(--success-color));
    color: white;
}

.btn-success:hover {
    background: hsl(var(--success-color) / 0.8);
    transform: translateY(-1px);
}

.btn-warning {
    background: hsl(var(--warning-color));
    color: white;
}

.btn-warning:hover {
    background: hsl(var(--warning-color) / 0.8);
    transform: translateY(-1px);
}

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

.btn-outline-primary:hover {
    background: hsl(var(--primary-color));
    color: white;
    transform: translateY(-1px);
}

/* Badge Styles */
.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
    border-radius: 0.375rem;
}

/* Table Styles */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    background: hsla(var(--primary-color), 0.08);
    border: none;
    font-weight: 600;
    color: hsl(var(--text-primary));
    padding: 1rem;
}

.table td {
    border: none;
    border-bottom: 1px solid hsla(var(--secondary-color), 0.15);
    padding: 1rem;
    color: hsl(var(--text-primary));
}

.table-hover tbody tr:hover {
    background: hsla(var(--primary-color), 0.04);
}

.text-muted {
    color: hsl(var(--text-muted)) !important;
}

/* Table Alignment */
.text-right {
    text-align: right !important;
}

.text-center {
    text-align: center !important;
}

.currency-amount {
    text-align: right;
    font-family: 'Courier New', monospace;
}

.percentage-rate {
    text-align: center;
    font-weight: 600;
}

/* Enhanced button styles */
.btn-outline-danger {
    border-color: #dc3545;
    color: #dc3545;
    background-color: transparent;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

[data-theme="dark"] .btn-outline-danger {
    border: 2px solid #ff4757;
    color: #ff4757;
    background-color: hsl(0 0% 10%);
    font-weight: 600;
}

[data-theme="dark"] .btn-outline-danger:hover,
[data-theme="dark"] .btn-outline-danger:focus {
    background-color: #ff4757;
    border-color: #ff4757;
    color: #fff;
    box-shadow: 0 0 0 3px hsla(348, 100%, 65%, 0.3);
}

.btn-outline-success {
    border: 2px solid #28a745;
    color: #28a745;
    background-color: transparent;
    font-weight: 600;
}

.btn-outline-success:hover,
.btn-outline-success:focus {
    background-color: #28a745;
    border-color: #28a745;
    color: #fff;
}

[data-theme="dark"] .btn-outline-success {
    border: 2px solid #2ed573;
    color: #2ed573;
    background-color: hsl(0 0% 10%);
    font-weight: 600;
}

[data-theme="dark"] .btn-outline-success:hover,
[data-theme="dark"] .btn-outline-success:focus {
    background-color: #2ed573;
    border-color: #2ed573;
    color: #fff;
    box-shadow: 0 0 0 3px hsla(148, 80%, 50%, 0.3);
}

/* Form Styles */
.form-control {
    border: 2px solid hsla(var(--secondary-color), 0.4);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    background: hsl(0 0% 95%);
    color: hsl(var(--text-primary));
    box-shadow: inset 0 1px 3px hsla(var(--dark-color), 0.05);
}

.form-control:focus {
    border-color: hsl(var(--primary-color));
    box-shadow: 0 0 0 0.15rem hsla(var(--primary-color), 0.15), inset 0 1px 3px hsla(var(--dark-color), 0.05);
    background: hsl(0 0% 100%);
    color: hsl(var(--text-primary));
}

[data-theme="dark"] .form-control {
    background: hsl(0 0% 15%);
    border: 2px solid hsl(0 0% 35%);
    color: hsl(0 0% 90%);
}

[data-theme="dark"] .form-control:focus {
    background: hsl(0 0% 8%);
    border: 2px solid hsl(var(--primary-color));
    color: hsl(0 0% 100%);
    font-weight: 500;
    box-shadow: 0 0 0 3px hsla(var(--primary-color), 0.3);
}

.form-control::placeholder {
    color: hsl(var(--text-muted));
    opacity: 0.7;
}

.form-select {
    border: 2px solid hsla(var(--secondary-color), 0.4);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    background: hsl(0 0% 95%);
    color: hsl(var(--text-primary));
    box-shadow: inset 0 1px 3px hsla(var(--dark-color), 0.05);
}

.form-select:focus {
    border-color: hsl(var(--primary-color));
    box-shadow: 0 0 0 0.15rem hsla(var(--primary-color), 0.15), inset 0 1px 3px hsla(var(--dark-color), 0.05);
    background: hsl(0 0% 100%);
    color: hsl(var(--text-primary));
}

.form-label {
    color: hsl(var(--text-primary));
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Switch Styles */
.form-check-input:checked {
    background-color: hsl(var(--success-color));
    border-color: hsl(var(--success-color));
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem hsla(var(--success-color), 0.25);
}

/* Navigation */
.navbar-dark .navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    transition: all 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: white;
    transform: translateY(-1px);
}

/* List Group */
.list-group-item {
    border: none;
    background: transparent;
    transition: all 0.3s ease;
    color: hsl(var(--text-primary));
}

.list-group-item:hover {
    background: hsla(var(--primary-color), 0.04);
}

.list-group-item h6 {
    color: hsl(var(--text-primary)) !important;
    font-weight: 600;
}

.list-group-item .small {
    color: hsl(var(--text-muted)) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .crypto-icons {
        font-size: 2.5rem;
    }
    
    .auth-card {
        padding: 2rem;
        margin: 1rem;
    }
    
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* 모바일에서 입력 필드 크기 조정 */
    .form-control,
    .form-select {
        max-width: 120px;
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* 전체 폭이 필요한 입력 필드들은 예외 처리 */
    .form-control.w-100,
    .form-select.w-100,
    .form-control[type="email"],
    .form-control[type="password"],
    .form-control[type="text"]:not([type="number"]),
    textarea.form-control {
        max-width: 100%;
    }
    
    /* 거래 설정 관련 숫자 입력 필드 */
    .form-control[step],
    .form-control[type="number"] {
        max-width: 100px;
        text-align: center;
    }
    
    /* 테이블 내 입력 필드 */
    .table .form-control {
        max-width: 80px;
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* 카드 내 폼 그룹 간격 조정 */
    .card-body .row .col {
        margin-bottom: 0.5rem;
    }
}

/* 더 작은 화면 (480px 이하) */
@media (max-width: 480px) {
    .form-control[type="number"],
    .form-control[step] {
        max-width: 80px;
        font-size: 0.8rem;
    }
    
    .table .form-control {
        max-width: 60px;
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
    
    /* 모바일에서 테이블 스크롤 */
    .table-responsive {
        font-size: 0.875rem;
    }
    
    /* 버튼 크기 조정 */
    .btn-sm {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, hsla(var(--primary-color), 0.1), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 삼각거래 결과 시각화 스타일 */
.triangular-stats {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.triangular-stats:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

[data-theme="dark"] .triangular-stats {
    background: linear-gradient(135deg, hsl(210 11% 15%) 0%, hsl(210 11% 20%) 100%);
}

.profit-highlight {
    background: linear-gradient(90deg, rgba(40, 167, 69, 0.1), rgba(40, 167, 69, 0.05));
    border-left: 4px solid #28a745;
}

.chart-container {
    position: relative;
    height: 200px;
    margin-bottom: 1rem;
}

#resultsTable {
    font-size: 0.9rem;
}

#resultsTable td {
    vertical-align: middle;
    padding: 0.75rem 0.5rem;
}

/* 애니메이션 효과 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .chart-container {
        height: 150px;
    }
    
    #resultsTable {
        font-size: 0.8rem;
    }
    
    .triangular-stats h5 {
        font-size: 1rem;
    }
    
    .triangular-stats small {
        font-size: 0.7rem;
    }
}



/* Hide number input spinners/arrows */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}
