* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', Arial, sans-serif;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: #1a202c;
    line-height: 1.6;
}

.kac-tl-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
}

.main-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: space-between;
}

.content-wrapper {
    display: flex;
    flex-wrap: nowrap !important;
    gap: 30px;
    width: 100%;
}

.currency-converter-container {
    flex: 3;
    max-width: 800px;
    min-width: 0;
}

.sidebar-wrapper {
    flex: 1;
    min-width: 250px;
    max-width: 300px;
    position: sticky !important;
    top: 20px;
    align-self: flex-start;
}

.header-section {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
}

.main-title {
    font-size: 28px;
    font-weight: 800;
    color: #333;
    margin-bottom: 12px;
    border-left: 15px solid #64bc45;
    padding-left: 10px;
    transition: color 0.3s ease;
}

.main-title:hover {
    color: #2c3e50;
}

.subtitle {
    font-size: 18px;
    color: #6c757d;
    font-weight: 400;
}

.calculator-section {
    background: #ffffff;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    margin-bottom: 30px;
}

.horizontal-converter {
    display: flex;
    gap: 1.5rem;
    background: #e0e5ec;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: inset 5px 5px 10px #a3b1c6, inset -5px -5px 10px #ffffff;
    transition: box-shadow 0.3s ease;
}

.horizontal-converter:hover {
    box-shadow: inset 3px 3px 8px #a3b1c6, inset -3px -3px 8px #ffffff;
}

.converter-form {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.converter-title {
    margin-bottom: 1.5rem;
}

.converter-title h2 {
    color: #6c63ff;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.converter-title p {
    color: #6c757d;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.input-container {
    margin-bottom: 1.2rem;
}

.input-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #5a5a5a;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.neumorphic-input {
    display: flex;
    border-radius: 12px;
    overflow: hidden;
    background: #e0e5ec;
    box-shadow: inset 5px 5px 8px #a3b1c6, inset -5px -5px 8px #ffffff;
    transition: box-shadow 0.3s ease;
}

.neumorphic-input:hover {
    box-shadow: inset 3px 3px 6px #a3b1c6, inset -3px -3px 6px #ffffff;
}

.input-control {
    flex: 1;
    padding: 0.8rem;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    color: #3d3d3d;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-control:focus {
    outline: none;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
    transform: translateY(-1px);
}

.currency-selector {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px;
    padding-right: 50px;
    cursor: pointer;
}

.neumorphic-btn {
    width: 100%;
    padding: 0.8rem;
    background: #6c63ff;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.neumorphic-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    background: #5a54d6;
}

.result-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.result-display {
    padding: 1.5rem;
    background: #e0e5ec;
    border-radius: 12px;
    text-align: center;
    box-shadow: inset 5px 5px 10px #a3b1c6, inset -5px -5px 10px #ffffff;
    transition: box-shadow 0.3s ease;
}

.result-display:hover {
    box-shadow: inset 3px 3px 8px #a3b1c6, inset -3px -3px 8px #ffffff;
}

.result-label {
    font-size: 0.9rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.result-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0.5rem 0;
    color: #6c63ff;
}

.result-unit {
    font-size: 1rem;
    color: #6c757d;
    font-weight: 500;
}

.rates-section {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    margin-bottom: 20px;
}

.rates-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.rates-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.rate-card {
    background: #e0e5ec;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: inset 5px 5px 8px #a3b1c6, inset -5px -5px 8px #ffffff;
    transition: all 0.2s ease;
}

.rate-card:hover {
    box-shadow: inset 3px 3px 6px #a3b1c6, inset -3px -3px 6px #ffffff;
    transform: translateY(-2px);
}

.rate-type {
    font-size: 12px;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.rate-amount {
    font-size: 24px;
    font-weight: 800;
}

.buy-rate .rate-amount { color: #48bb78; }
.sell-rate .rate-amount { color: #f56565; }

.update-info {
    text-align: center;
    padding: 15px;
    background: #e0e5ec;
    border-radius: 12px;
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
    box-shadow: inset 5px 5px 8px #a3b1c6, inset -5px -5px 8px #ffffff;
}

.currency-content-section {
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 20px auto;
}

.currency-content-section h2 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #333;
}

.currency-content-section h3 {
    font-size: 20px;
    margin: 15px 0 10px;
    color: #333;
}

.currency-content-section p {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
}

.other-currencies-container {
    margin-top: 20px;
    max-width: 800px;
}

.other-currencies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.currency-box {
    background: #ffffff;
    padding: 15px;
    text-align: center;
    text-decoration: none;
    color: #333;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.currency-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    background: #f0f4ff;
}

.currency-flag {
    width: 45px;
    height: 45px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.error-message {
    background: #fff5f5;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    color: #e53e3e;
    border: 1px solid #feb2b2;
}

.market-closed-message {
    background: #e2e8f0;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    margin-top: 10px;
    color: #4a5568;
    border: 1px solid #cbd5e0;
}

.calculation-details {
    margin-top: 10px;
    margin-bottom: 15px;
    overflow-x: auto;
}

.calculation-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    overflow: hidden;
}

.calculation-table th,
.calculation-table td {
    padding: 12px 15px;
    text-align: center;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
}

.calculation-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #555;
}

.calculation-table tbody tr:last-child {
    border-bottom: none;
}

.calculation-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.calculation-table tbody tr:hover {
    background: #f0f4ff;
    transition: background 0.3s ease;
}

@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column !important;
        gap: 20px;
    }
    .currency-converter-container {
        max-width: 100%;
        flex: 1;
    }
    .sidebar-wrapper {
        max-width: 100%;
        flex: 1;
        position: static !important;
    }
}

@media (max-width: 576px) {
    .main-title {
        font-size: 24px;
    }
    .horizontal-converter {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    .currency-converter-container {
        padding: 0 10px;
    }
    .currency-content-section,
    .other-currencies-container {
        max-width: 100%;
    }
    .result-value {
        font-size: 1.3rem;
    }
    .rate-card {
        padding: 0.5rem 0.6rem;
    }
    .rate-amount {
        font-size: 1rem;
    }
    .other-currencies-grid {
        grid-template-columns: 1fr;
    }
    .currency-flag {
        width: 40px;
        height: 40px;
    }
    .calculation-table th,
    .calculation-table td {
        font-size: 12px;
        padding: 8px;
    }
}