:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #7209b7;
    --light: #f8f9fa;
    --dark: #212529;
    --success: #4cc9f0;
    --danger: #f72585;
    --warning: #f8961e;
    --info: #4895ef;
    --gray: #6c757d;
    --border-radius: 12px;
    --box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

h1 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.subtitle {
    color: var(--gray);
    font-size: 1.1rem;
}

.app-container {
    display: grid;
    gap: 30px;
}

@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
    }
}

.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 25px;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--primary);
    font-size: 1.3rem;
}

.card-title i {
    font-size: 1.5rem;
}

.input-section {
    margin-bottom: 20px;
}

textarea {
    width: 100%;
    height: 150px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    resize: vertical;
    font-size: 1rem;
    transition: var(--transition);
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.input-options {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #5a08a0;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #3ab0d6;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #e01a6f;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #e0861b;
}

.results-section {
    margin-top: 20px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.result-card {
    background: var(--light);
    padding: 15px;
    border-radius: var(--border-radius);
    text-align: center;
    border-left: 4px solid var(--primary);
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin: 10px 0;
}

.result-label {
    font-size: 0.9rem;
    color: var(--gray);
}

.chart-container {
    height: 300px;
    margin-top: 20px;
}

.history-section {
    margin-top: 20px;
}

.history-item {
    background: var(--light);
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-data {
    font-weight: 600;
}

.history-stats {
    font-size: 0.9rem;
    color: var(--gray);
}

.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.tab {
    padding: 12px 20px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
}

.tab.active {
    border-bottom: 3px solid var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.probability-calculator {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--dark);
}

input, select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: var(--gray);
    font-size: 0.9rem;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: var(--success);
    color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transform: translateX(150%);
    transition: transform 0.5s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: var(--dark);
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.9rem;
    font-weight: normal;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}