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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

h1 {
    color: #667eea;
    text-align: center;
    margin-bottom: 10px;
    font-size: 2.5em;
}

.date-display {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.backup-section {
    background: #e8f5e9;
    border: 2px solid #4caf50;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.backup-section h3 {
    color: #2e7d32;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.backup-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.last-backup {
    margin-top: 10px;
    font-size: 0.9em;
    color: #555;
}

.add-habit-section {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 10px;
}

.add-habit-section input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.add-habit-section input:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #4caf50;
    color: white;
}

.btn-success:hover {
    background: #45a049;
}

.btn-warning {
    background: #ff9800;
    color: white;
}

.btn-warning:hover {
    background: #e68900;
}

.btn-info {
    background: #2196F3;
    color: white;
}

.btn-info:hover {
    background: #0b7dda;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 10px;
    gap: 20px;
}

.week-navigation {
    display: flex;
    gap: 15px;
    align-items: center;
}

.week-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 250px;
}

.week-label {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.week-range {
    font-size: 0.9em;
    color: #666;
}

.nav-btn {
    padding: 10px 20px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.nav-btn:disabled:hover {
    background: white;
    color: #667eea;
    transform: none;
}

.today-btn {
    padding: 10px 20px;
    border: 2px solid #4caf50;
    background: #4caf50;
    color: white;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.today-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.habit-grid-container {
    overflow-x: auto;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.habit-grid {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.habit-grid th {
    background: #667eea;
    color: white;
    padding: 4px 10px;
    text-align: center;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.habit-grid th.today-column {
    background: #4caf50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.habit-grid td.today-column {
    background: #f1f8f4;
}

.habit-grid th:first-child {
    text-align: left;
    padding-left: 20px;
    min-width: 100px;
}

.habit-grid td {
    padding: 10px;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.habit-grid td:first-child {
    text-align: left;
    padding-left: 20px;
    font-weight: 600;
    color: #333;
    background: #f8f9ff;
    position: sticky;
    left: 0;
    z-index: 5;
}

.habit-name-cell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.delete-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em;
    transition: background 0.3s;
}

.delete-btn:hover {
    background: #ee5a52;
}

.habit-cell {
    width: 30px;
    height: 30px;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    transition: all 0.3s;
    margin: 0 auto;
}

.habit-cell.completed {
    background: #4caf50;
    color: white;
}

.habit-cell.not-completed {
    background: #f44336;
    color: white;
}

.habit-cell.not-set {
    background: #e0e0e0;
    color: #999;
}

.habit-cell:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.habit-cell.locked {
    cursor: not-allowed;
    opacity: 0.6;
    position: relative;
}


.habit-cell.locked:hover {
    transform: none;
    box-shadow: none;
}

.score-row {
    background: #f0f0f0 !important;
    font-weight: bold;
}

.score-row td {
    background: #f0f0f0 !important;
    color: #667eea;
    font-size: 1.1em;
    padding: 15px 10px;
}

.chart-section {
    margin-top: 40px;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 12px;
}

.chart-section h2 {
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
}

.chart-container {
    position: relative;
    height: 400px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-box {
    width: 30px;
    height: 30px;
    border-radius: 5px;
}

.legend-box.completed {
    background: #4caf50;
}

.legend-box.not-completed {
    background: #f44336;
}

.legend-box.not-set {
    background: #e0e0e0;
}

.storage-info {
    background: #e3f2fd;
    border: 1px solid #2196F3;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    font-size: 0.9em;
    text-align: center;
}

input[type="file"] {
    display: none;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 1.8em;
    }

    .controls {
        flex-direction: column;
        gap: 15px;
    }

    .backup-buttons {
        flex-direction: column;
    }

    .habit-cell {
        width: 50px;
        height: 50px;
        font-size: 1.2em;
    }

    .habit-grid th,
    .habit-grid td {
        padding: 8px 5px;
    }
}