:root {
    --primary: #6a43db;
    --secondary: #3d59e0;
    --dark: #121212;
    --light: #f9f9f9;
    --gray: #575757;
    --light-gray: #e0e0e0;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

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

.header {
    text-align: center;
    margin-bottom: 30px;
    background-color: #6a43db;
    color: white;
    padding: 20px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(106, 67, 219, 0.9), rgba(70, 27, 187, 0.9));
    z-index: -1;
}

.header h1 {
    font-size: 36px;
    letter-spacing: 1px;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.calculator {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid var(--light-gray);
    font-size: 16px;
}

.two-columns {
    display: flex;
    gap: 20px;
}

.two-columns > div {
    flex: 1;
}

button {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 12px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
}

button:hover {
    background-color: var(--secondary);
}

.result {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.result h2 {
    margin-bottom: 20px;
    color: var(--primary);
}

.metric {
    margin-bottom: 15px;
}

.metric-title {
    font-weight: 600;
    display: block;
}

.info-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    font-size: 14px;
    cursor: help;
    margin-left: 5px;
}

.tooltip {
    position: absolute;
    background-color: var(--dark);
    color: white;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
    max-width: 300px;
    z-index: 100;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s;
}

.info-icon:hover + .tooltip {
    visibility: visible;
    opacity: 1;
}

.model-selection {
    margin-bottom: 30px;
}

.model-selection h3 {
    margin-bottom: 15px;
}

.model-cards {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.model-card {
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    padding: 15px;
    flex: 1;
    min-width: 200px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.model-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.model-card.selected {
    border-color: var(--primary);
    box-shadow: 0 5px 15px rgba(74, 108, 247, 0.2);
}

.model-card h4 {
    margin-bottom: 10px;
    color: var(--dark);
}

.model-metric {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 14px;
}

.hardware-selection {
    margin-bottom: 30px;
}

.hardware-cards {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.hardware-card {
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    padding: 15px;
    flex: 1;
    min-width: 200px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.hardware-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.hardware-card.selected {
    border-color: var(--primary);
    box-shadow: 0 5px 15px rgba(74, 108, 247, 0.2);
}

.hardware-card h4 {
    margin-bottom: 10px;
    color: var(--dark);
}

.counter-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 120px;
    margin-top: 10px;
}

.counter-btn {
    width: 30px;
    height: 30px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.counter-display {
    font-size: 18px;
    font-weight: bold;
}

.performance-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 25px;
}

.performance-card {
    flex: 1 1 calc(33.33% - 15px);
    min-width: 250px;
    padding: 15px;
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-top: 3px solid var(--primary);
}

.performance-card h3 {
    margin-bottom: 10px;
    color: var(--primary);
}

.performance-card p {
    margin-bottom: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

table, th, td {
    border: 1px solid var(--light-gray);
}

th, td {
    padding: 12px;
    text-align: left;
}

th {
    background-color: #f1f1f1;
}

.comparison-section {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--warning);
}

.cost-comparison {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.cost-card {
    flex: 1 1 calc(33.33% - 15px);
    min-width: 250px;
    padding: 15px;
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cost-card h4 {
    margin-bottom: 10px;
    color: var(--dark);
}

.warning-badge {
    display: inline-block;
    background-color: var(--warning);
    color: var(--dark);
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 10px;
    font-weight: bold;
}

.impossible-badge {
    display: inline-block;
    background-color: var(--danger);
    color: white;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 10px;
    font-weight: bold;
}

.optimal-badge {
    display: inline-block;
    background-color: var(--success);
    color: white;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 10px;
    font-weight: bold;
}

.requirements-table {
    width: 100%;
    margin-bottom: 20px;
}

.requirements-table th {
    background-color: var(--primary);
    color: white;
}

@media (max-width: 768px) {
    .two-columns {
        flex-direction: column;
    }
    
    .container {
        padding: 10px;
    }
    
    .performance-card, .cost-card {
        flex: 1 1 100%;
    }
}
