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

body {
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 900px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    margin-top: 20px;
}

header {
    background: #4a6fc7;
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.description {
    font-size: 16px;
    opacity: 0.9;
}

.tabs {
    display: flex;
    background: #3a5bb8;
    padding: 0;
}

.tab {
    padding: 15px 20px;
    color: white;
    cursor: pointer;
    flex: 1;
    text-align: center;
    transition: background 0.3s;
}

.tab.active {
    background: #2c4da1;
    font-weight: bold;
}

.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

.card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.deck-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #4a6fc7;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.question {
    font-size: 18px;
    margin-bottom: 15px;
    text-align: center;
    color: #2c3e50;
}

.answer {
    font-size: 18px;
    text-align: center;
    color: #7f8c8d;
    margin-top: 15px;
    display: none;
}

.show-answer {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    margin: 15px auto;
    display: block;
    transition: background 0.3s;
    font-size: 16px;
}

.show-answer:hover {
    background: #2980b9;
}

.rating-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    display: none;
    flex-wrap: wrap;
}

.rating-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
    margin: 5px;
    flex: 1;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rating-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.interval {
    font-size: 12px;
    margin-top: 5px;
    font-weight: normal;
}

.again {
    background: #e74c3c;
    color: white;
}

.hard {
    background: #f39c12;
    color: white;
}

.good {
    background: #2ecc71;
    color: white;
}

.easy {
    background: #3498db;
    color: white;
}

.stats {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    padding: 15px;
    background: #e8f4fc;
    border-radius: 10px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 10px;
    min-width: 120px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

.stat-label {
    font-size: 14px;
    color: #7f8c8d;
}

.progress-bar {
    height: 10px;
    background: #ecf0f1;
    border-radius: 5px;
    margin: 20px 0;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: #2ecc71;
    width: 0%;
    transition: width 0.5s;
}

.form-container {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.form-title {
    text-align: center;
    margin-bottom: 15px;
    color: #2c3e50;
}

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

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

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.submit-btn {
    background: #2ecc71;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    display: block;
    margin: 0 auto;
    transition: background 0.3s;
}

.submit-btn:hover {
    background: #27ae60;
}

.decks-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.deck-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s;
    cursor: pointer;
}

.deck-card:hover {
    transform: translateY(-5px);
}

.deck-icon {
    font-size: 40px;
    margin-bottom: 15px;
    color: #4a6fc7;
}

.deck-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.deck-stats {
    font-size: 14px;
    color: #7f8c8d;
}

footer {
    text-align: center;
    padding: 20px;
    color: white;
    margin-top: 30px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .rating-buttons {
        flex-direction: column;
    }
    
    .rating-btn {
        width: 100%;
        margin: 5px 0;
    }
    
    .stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .decks-container {
        grid-template-columns: 1fr;
    }
}

/* Стиль для новых карточек */
.deck-badge.new-card {
    background: #3498db;
}

/* Иконка новой карточки */
.new-card-indicator {
    color: #3498db;
    margin-right: 5px;
}

/* Прогресс-бар с разделением на изученные и новые */
.progress {
    background: linear-gradient(
        90deg,
        #2ecc71 var(--learned-percent), 
        #3498db var(--learned-percent), 
        #3498db var(--total-percent),
        #ecf0f1 var(--total-percent)
    );
}

.next-review {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    color: #7f8c8d;
    display: none;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px;
    border-radius: 5px;
    background: #2ecc71;
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 1000;
}

/* Стили для статистики */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.activity-day {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
}

.activity-date {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 8px;
}

.activity-reviews {
    font-size: 18px;
    color: #3498db;
    margin-bottom: 5px;
}

.activity-rating {
    font-size: 14px;
    color: #f39c12;
}

.rating-bars {
    margin-top: 20px;
}

.rating-bar {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.rating-label {
    width: 80px;
    font-weight: bold;
    color: #2c3e50;
}

.rating-bar-container {
    flex: 1;
    height: 20px;
    background: #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
    margin: 0 15px;
}

.rating-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c, #f39c12, #2ecc71, #3498db);
    transition: width 0.5s ease;
}

.rating-count {
    width: 80px;
    text-align: right;
    font-size: 14px;
    color: #7f8c8d;
}

.deck-progress-item {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.deck-progress-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.deck-progress-icon {
    font-size: 24px;
    color: #4a6fc7;
    margin-right: 15px;
}

.deck-progress-info {
    flex: 1;
}

.deck-progress-name {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 3px;
}

.deck-progress-numbers {
    font-size: 14px;
    color: #7f8c8d;
}

.deck-progress-percentage {
    font-weight: bold;
    color: #2c3e50;
    font-size: 18px;
}

.stats-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.stats-section h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

.no-data {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 20px;
}

/* Адаптивность для статистики */
@media (max-width: 768px) {
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stats {
        grid-template-columns: 1fr;
    }
}

/* Цвет для новых карточек */
.stat-item:nth-child(4) .stat-value {
    color: #3498db; /* Синий цвет для новых карточек */
}

.stat-item:nth-child(5) .stat-value {
    color: #f39c12; /* Оранжевый цвет для сегодняшних */
}

@media (max-width: 768px) {
    .rating-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .rating-label {
        width: auto;
        margin-bottom: 5px;
    }
    
    .rating-bar-container {
        margin: 5px 0;
    }
    
    .rating-count {
        width: auto;
        text-align: left;
    }
    
    .deck-progress-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .deck-progress-icon {
        margin-bottom: 10px;
    }
    
    .deck-progress-percentage {
        align-self: flex-end;
        margin-top: 10px;
    }
}

/* Стили для модального окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.modal-header {
    background: #4a6fc7;
    color: white;
    padding: 15px 20px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.close {
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #ccc;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 0 0 10px 10px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Стили для кнопок */
.btn-primary {
    background: #2ecc71;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.btn-danger {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.btn-settings {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
}

/* Стили для неактивных колод */
.deck-inactive {
    opacity: 0.6;
    background: #f8f9fa;
}

.deck-inactive .deck-title {
    color: #7f8c8d;
}

.deck-settings {
    margin-top: 10px;
    text-align: center;
}

/* Адаптивность для модального окна */
@media (max-width: 768px) {
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer button {
        width: 100%;
        margin-bottom: 5px;
    }
}