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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f4f8;
    color: #333;
    line-height: 1.6;
}

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

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 15px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 1px;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    padding: 8px 15px;
    border-radius: 25px;
    transition: background 0.3s, transform 0.3s;
}

nav ul li a:hover, nav ul li a.active {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.hamburger {
    display: none;
    font-size: 28px;
    cursor: pointer;
}

.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-align: center;
    padding: 80px 20px;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 36px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 18px;
    margin-bottom: 30px;
}

.btn-primary {
    background: #ff6b6b;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.btn-primary:hover {
    background: #ff4757;
    transform: translateY(-3px);
}

.btn-secondary {
    background: #2ed573;
    color: #fff;
    border: none;
    padding: 10px 25px;
    border-radius: 30px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
    margin: 5px;
}

.btn-secondary:hover {
    background: #26de81;
    transform: translateY(-2px);
}

.btn-danger {
    background: #ff4757;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-danger:hover {
    background: #e84118;
}

.generator {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

.generator h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
    color: #667eea;
}

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

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

.form-group input, .form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 12px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus, .form-group select:focus {
    border-color: #667eea;
    outline: none;
}

.form-group input[type="range"] {
    padding: 0;
}

.result-box {
    background: #f9f9f9;
    border-radius: 15px;
    padding: 25px;
    margin-top: 20px;
    border-left: 5px solid #667eea;
}

.result-box h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.optimization-box {
    background: #fff3cd;
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
    border-left: 5px solid #ffc107;
}

.features {
    padding: 40px 0;
}

.features h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
    color: #667eea;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.card {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.card h3 {
    color: #764ba2;
    margin-bottom: 15px;
    font-size: 20px;
}

.card p {
    color: #666;
}

footer {
    background: #333;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

footer a {
    color: #667eea;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.admin-page .container {
    max-width: 800px;
}

.admin-form {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.admin-form h2 {
    color: #667eea;
    margin-bottom: 20px;
}

.error {
    color: #ff4757;
    margin-top: 10px;
}

.success {
    color: #2ed573;
    margin-top: 10px;
}

.history-list {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.history-item {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item p {
    margin: 5px 0;
}

#loading {
    text-align: center;
    font-size: 18px;
    color: #667eea;
    padding: 20px;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        background: rgba(102,126,234,0.95);
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        padding: 20px;
        border-radius: 0 0 20px 20px;
    }

    .nav-links.active {
        display: flex;
    }

    .hamburger {
        display: block;
    }

    .hero h1 {
        font-size: 24px;
    }

    .generator {
        padding: 20px;
    }

    .history-item {
        flex-direction: column;
        text-align: left;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}