* {
    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;
    color: #333;
}

header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

header h1 {
    color: white;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}

.back-btn {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: white;
    transform: translateY(-50%) translateX(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

main {
    max-width: 800px;
    margin: 0 auto;
}

section {
    background: rgba(255,255,255,0.95);
    margin-bottom: 25px;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.habit-form form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: end;
}

input, select, button {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    min-width: 120px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.habit-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin-bottom: 15px;
    background: #f8fafc;
    border-radius: 15px;
    border-left: 5px solid #667eea;
    transition: all 0.3s ease;
}

.habit-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.habit-info {
    flex-grow: 1;
}

.habit-name {
    font-size: 1.3em;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

.habit-details {
    color: #718096;
    font-size: 0.95em;
    display: flex;
    gap: 15px;
}

.habit-actions {
    display: flex;
    gap: 10px;
}

.complete-btn {
    background: #48bb78;
    padding: 10px 20px;
    font-size: 14px;
}

.edit-btn {
    background: #ed8936;
    padding: 10px 15px;
    font-size: 14px;
}

.delete-btn {
    background: #f56565;
    padding: 10px 15px;
    font-size: 14px;
}

.habit-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

#clearFilters {
    background: #48bb78;
    padding: 12px 24px;
}

.stats {
    text-align: center;
}

.streak-item {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    margin: 10px;
    border-radius: 15px;
    min-width: 120px;
}

@media (max-width: 768px) {
    .habit-form form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .habit-actions {
        flex-direction: column;
    }
    
    .habit-filters {
        flex-direction: column;
        align-items: stretch;
    }
}