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

body {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1e3a5f, #2d5a8c);
}

.container {
    width: 340px;
    padding: 25px;
    border-radius: 20px;
    backdrop-filter: blur(15px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    text-align: center;
    color: white;
}

h2 {
    margin-bottom: 20px;
    font-weight: 600;
}

h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
}

input, select {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border-radius: 10px;
    border: none;
    outline: none;
    background: rgba(255,255,255,0.2);
    color: white;
}

input::placeholder {
    color: #ddd;
}

select option {
    color: black;
}

.toggle {
    display: flex;
    justify-content: space-around;
    margin: 10px 0;
    font-size: 14px;
}

.toggle label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 14px;
}

.toggle input[type="radio"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

button {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.add {
    background: #00c853;
    color: white;
}

.remove {
    background: #ff5252;
    color: white;
}

.reset {
    background: #2979ff;
    color: white;
}

button:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

#result {
    margin-top: 15px;
    font-size: 16px;
    color: #fff;
    background: rgba(255,255,255,0.1);
    padding: 10px;
    border-radius: 10px;
}

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

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: rgba(255,255,255,0.3);
    color: white;
    font-size: 18px;
}

/* Dark Theme */
body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e, #0f3460);
}

body.dark-mode .container {
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
}

body.dark-mode input, body.dark-mode select {
    background: rgba(0,0,0,0.3);
    color: #fff;
}

body.dark-mode select option {
    background: #333;
    color: #fff;
}

body.dark-mode #error {
    color: #ff6b6b;
}

#historyList {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    max-height: 120px;
    overflow-y: auto;
    text-align: left;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 10px;
    font-size: 14px;
}

#historyList li {
    padding: 8px;
    margin: 5px 0;
    background: rgba(255,255,255,0.05);
    border-radius: 5px;
    font-size: 13px;
    border-left: 3px solid #00c853;
}

.export {
    width: 100%;
    background: #ff9800;
    margin-top: 10px;
    color: white;
}

.export:hover {
    background: #f57c00;
}

/* Light Mode */
.light-mode {
    background: #e8eef5 !important;
}

.light-mode .container {
    background: white;
    color: black;
    backdrop-filter: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.light-mode input,
.light-mode select {
    background: #eee;
    color: black;
}

.light-mode #result {
    background: #f1f1f1;
    color: black;
}

.light-mode #historyList {
    background: rgba(0,0,0,0.05);
}

.light-mode #historyList li {
    background: rgba(0,0,0,0.03);
}

.light-mode .export {
    background: #ff9800;
}

.light-mode .export:hover {
    background: #f57c00;
}

/* Responsive Design */
@media (max-width: 480px) {
    body {
        height: auto;
        padding: 20px 10px;
        min-height: 100vh;
    }

    .container {
        width: 100%;
        max-width: 95vw;
        padding: 20px;
        border-radius: 15px;
    }

    h2 {
        font-size: 24px;
        margin-bottom: 15px;
    }

    h3 {
        font-size: 14px;
        margin-top: 15px;
    }

    input, select {
        padding: 12px;
        margin: 8px 0;
        font-size: 16px;
    }

    button {
        padding: 12px;
        margin: 6px 0;
        font-size: 14px;
    }

    .toggle {
        flex-direction: column;
        gap: 8px;
    }

    .toggle label {
        font-size: 12px;
        justify-content: flex-start;
        padding: 8px;
        background: rgba(255,255,255,0.05);
        border-radius: 5px;
    }

    #historyList {
        max-height: 100px;
        font-size: 12px;
        padding: 8px;
    }

    #historyList li {
        padding: 6px;
        margin: 4px 0;
        font-size: 12px;
    }

    .theme-toggle {
        width: 35px;
        height: 35px;
        font-size: 16px;
        top: 15px;
        right: 15px;
    }

    .container .theme-toggle {
        width: 35px;
        height: 35px;
        margin: -8px 0 8px auto;
    }

    #result {
        font-size: 14px;
        padding: 8px;
    }
}

@media (max-width: 768px) {
    .container {
        width: 100%;
        max-width: 500px;
        padding: 20px;
    }

    input, select {
        font-size: 16px;
    }

    #historyList {
        max-height: 130px;
    }
}
