/* 
 * CryptoConverter - Main Stylesheet
 * Custom styles for cryptocurrency conversion system
 */

/* General Styles */
:root {
    --primary-color: #FF6B35;        /* Pizza sauce orange */
    --secondary-color: #D2001F;      /* Deep red like pepperoni */
    --accent-color: #FFD23F;         /* Golden cheese yellow */
    --light-color: #FFF8E7;          /* Warm cream like mozzarella */
    --dark-color: #8B4513;           /* Pizza crust brown */
    --gray-color: #A0522D;           /* Warm brown-gray */
    --success-color: #228B22;        /* Basil green */
    --danger-color: #DC143C;         /* Tomato red */
    --warning-color: #FF8C00;        /* Orange warning */
    --info-color: #4682B4;           /* Steel blue */
    --crust-color: #DEB887;          /* Light crust color */
    --herb-green: #9ACD32;           /* Fresh herb green */
}

body {
    font-family: 'Rubik', sans-serif;
    background-color: var(--light-color);
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 107, 53, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 210, 63, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(210, 0, 31, 0.05) 0%, transparent 50%);
    color: var(--dark-color);
    min-height: 100vh;
}

/* RTL Support for Hebrew */
html[lang="he"] {
    direction: rtl;
}

html[lang="he"] .dropdown-menu {
    text-align: right;
}

html[lang="he"] .ms-2 {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

html[lang="he"] .me-2 {
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
}

html[lang="he"] .me-3 {
    margin-left: 1rem !important;
    margin-right: 0 !important;
}

html[lang="he"] .ms-1 {
    margin-right: 0.25rem !important;
    margin-left: 0 !important;
}

html[lang="en"] .ms-2 {
    margin-left: 0.5rem !important;
}

html[lang="en"] .me-2 {
    margin-right: 0.5rem !important;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
}

/* Header & Navigation */
.navbar .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color 0.3s;
}

.navbar .nav-link:hover {
    color: var(--primary-color);
}

.navbar .nav-link.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

/* Crypto Cards */
.crypto-card {
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    border: 2px solid rgba(255, 107, 53, 0.1);
    background: linear-gradient(145deg, #ffffff, var(--light-color));
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.1);
}

.crypto-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 15px 35px rgba(255, 107, 53, 0.2),
        0 5px 15px rgba(210, 0, 31, 0.1);
    border-color: var(--primary-color);
}

.crypto-card .card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1rem;
}

.crypto-card .crypto-icon {
    width: 32px;
    height: 32px;
}

html[lang="he"] .crypto-card .crypto-icon {
    margin-left: 10px;
}

html[lang="en"] .crypto-card .crypto-icon {
    margin-right: 10px;
}

.crypto-card .price-change {
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.crypto-card .price-change.positive {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.crypto-card .price-change.negative {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* Converter Section */
.converter-form {
    background: linear-gradient(145deg, #ffffff, var(--light-color));
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 
        0 10px 30px rgba(255, 107, 53, 0.1),
        0 5px 15px rgba(0,0,0,0.05);
    border: 2px solid rgba(255, 107, 53, 0.1);
    position: relative;
    overflow: hidden;
}

.converter-form::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 30% 70%, rgba(255, 210, 63, 0.05) 0%, transparent 30%),
        radial-gradient(circle at 70% 30%, rgba(210, 0, 31, 0.03) 0%, transparent 30%);
    pointer-events: none;
    z-index: 0;
}

.converter-form > * {
    position: relative;
    z-index: 1;
}

.converter-form .form-label {
    font-weight: 500;
}

.converter-form .btn-convert {
    padding: 0.75rem 2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 25px;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.converter-form .btn-convert:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
}

.conversion-result {
    padding: 1.5rem;
    border-radius: 10px;
    background-color: var(--light-color);
    margin-top: 1.5rem;
}

html[lang="he"] .conversion-result {
    border-right: 4px solid var(--primary-color);
}

html[lang="en"] .conversion-result {
    border-left: 4px solid var(--primary-color);
}

/* Crypto Detail Page */
.crypto-detail-card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.crypto-header {
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    background-size: 200% 200%;
    animation: pizzaGradient 6s ease infinite;
    color: white;
    position: relative;
    overflow: hidden;
}

.crypto-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 20%);
    pointer-events: none;
}

@keyframes pizzaGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.crypto-info {
    display: flex;
    align-items: center;
}

html[lang="he"] .crypto-info .crypto-icon {
    margin-left: 1rem;
}

html[lang="en"] .crypto-info .crypto-icon {
    margin-right: 1rem;
}

.crypto-stats {
    display: flex;
    flex-wrap: wrap;
    padding: 1rem;
    background-color: #fff;
}

.stat-item {
    flex: 1 0 33.333%;
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

html[lang="he"] .stat-item {
    border-left: 1px solid rgba(0,0,0,0.05);
}

html[lang="he"] .stat-item:nth-child(3n) {
    border-left: none;
}

html[lang="en"] .stat-item {
    border-right: 1px solid rgba(0,0,0,0.05);
}

html[lang="en"] .stat-item:nth-child(3n) {
    border-right: none;
}

.stat-item:nth-child(n+4):nth-child(-n+6) {
    border-bottom: none;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-color);
}

/* Price Chart */
.price-chart {
    background-color: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

/* Pagination */
.pagination .page-link {
    color: var(--primary-color);
    border-color: #dee2e6;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Footer */
footer {
    margin-top: auto;
}

footer .social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s;
}

footer .social-links a:hover {
    background-color: var(--primary-color);
}

/* Tooltip enhancements */
.tooltip-inner {
    max-width: 300px;
    text-align: left;
    padding: 12px;
}

.tooltip-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 8px;
}

/* Custom crypto tooltip styles */
.crypto-tooltip-wrapper {
    z-index: 9999;
}

.crypto-tooltip-wrapper .tooltip-inner {
    background-color: #fff;
    color: #333;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    max-width: 300px;
    padding: 12px;
}

.crypto-tooltip-wrapper .tooltip-arrow:before {
    border-top-color: #fff;
}

/* Legacy tooltip styles - keeping for backwards compatibility */
.crypto-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.crypto-tooltip .crypto-tooltip-text {
    visibility: hidden;
    width: 250px;
    background-color: var(--dark-color);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.875rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.crypto-tooltip .crypto-tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--dark-color) transparent transparent transparent;
}

.crypto-tooltip:hover .crypto-tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Responsive Styles */
@media (max-width: 767.98px) {
    .crypto-stats {
        flex-direction: column;
    }
    
    .stat-item {
        flex: 1 0 100%;
        border-left: none;
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    
    .stat-item:last-child {
        border-bottom: none;
    }
}

/* Cryptocurrency display styles */
.crypto-display {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.crypto-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 50%;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
}

.crypto-symbol {
    font-weight: 600;
}

.crypto-name {
    color: #6c757d;
    margin-left: 4px;
}

/* Currency input styles */
.currency-input-group .input-group-text {
    min-width: 60px;
    justify-content: center;
}

/* Bidirectional currency symbol handling */
[dir="rtl"] .currency-symbol {
    margin-left: 0;
    margin-right: 4px;
}

[dir="ltr"] .currency-symbol {
    margin-right: 0;
    margin-left: 4px;
}

/* Converter search */
.currency-search-input {
    border-bottom-right-radius: 0;
    border-top-right-radius: 0;
}

/* Currency dropdown */
.currency-select {
    max-height: 300px;
    overflow-y: auto;
}

/* Add group labels for currency types */
.currency-group-label {
    background: linear-gradient(90deg, var(--crust-color), var(--light-color));
    color: var(--dark-color);
    font-weight: 600;
    padding: 6px 12px;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-left: 3px solid var(--primary-color);
}

/* Pizza-themed enhancements */
.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.btn-success {
    background: linear-gradient(45deg, var(--success-color), var(--herb-green));
    border: none;
    border-radius: 20px;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Header styling */
.bg-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color)) !important;
    background-size: 200% 200%;
    animation: pizzaGradient 8s ease infinite;
}

/* Card enhancements */
.card {
    border-radius: 15px;
    border: 1px solid rgba(255, 107, 53, 0.1);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.05);
}

/* Form controls */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 53, 0.25);
}

/* Alert styling */
.alert-success {
    background-color: rgba(34, 139, 34, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
}

.alert-danger {
    background-color: rgba(220, 20, 60, 0.1);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

/* Pagination pizza theme */
.pagination .page-link {
    color: var(--primary-color);
    border-radius: 10px;
    margin: 0 2px;
    border: 1px solid rgba(255, 107, 53, 0.2);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-color: var(--primary-color);
    color: white;
}

/* Logo styling */
.logo-img {
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.logo-img:hover {
    transform: scale(1.1) rotate(5deg);
}

/* RTL support for logo */
html[lang="he"] .logo-img {
    margin-left: 0.5rem;
    margin-right: 0;
}

html[lang="en"] .logo-img {
    margin-right: 0.5rem;
    margin-left: 0;
} 