/* CSS Variables for theming */
:root {
    --primary-color: #e74c3c;
    --primary-hover: #c0392b;
    --secondary-color: #3498db;
    --secondary-hover: #2980b9;
    --background-color: #1a1a2e;
    --surface-color: #16213e;
    --surface-light: #1f3460;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-color: #f39c12;
    --success-color: #27ae60;
    --border-radius: 12px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--background-color) 0%, #0f0f23 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* App Container */
.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    padding: 30px 0;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo {
    width: 50px;
    height: 50px;
    border-radius: 10px;
}

h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(231, 76, 60, 0.3);
}

.tagline {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 10px;
}

/* Main Content */
main {
    flex: 1;
}

/* Controls Section */
.controls-section {
    background: var(--surface-color);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    display: grid;
    gap: 25px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* Severity Slider */
.severity-slider-container {
    position: relative;
}

#severity {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right,
        #27ae60 0%,
        #f1c40f 25%,
        #e67e22 50%,
        #e74c3c 75%,
        #8e44ad 100%
    );
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

#severity::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

#severity::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

#severity::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.severity-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.severity-indicator {
    text-align: center;
    margin-top: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 8px 16px;
    background: var(--surface-light);
    border-radius: 20px;
    display: inline-block;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
}

/* Select Dropdowns */
select {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface-light);
    border: 2px solid transparent;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

select:hover {
    border-color: var(--primary-color);
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
}

select option {
    background: var(--surface-color);
    color: var(--text-primary);
}

/* Generate Button */
.generate-btn {
    width: 100%;
    padding: 18px 30px;
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
    margin-bottom: 25px;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(231, 76, 60, 0.5);
}

.generate-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.4rem;
}

/* Insult Display */
.insult-display {
    background: var(--surface-color);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    text-align: center;
    border: 2px solid var(--surface-light);
    transition: var(--transition);
}

.insult-display:hover {
    border-color: var(--primary-color);
}

#insult-text {
    font-size: 1.4rem;
    line-height: 1.8;
    margin-bottom: 20px;
    color: var(--text-primary);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.insult-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    background: var(--surface-light);
    color: var(--text-primary);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.action-btn:active {
    transform: translateY(0);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--success-color);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Favorites Section */
.favorites-section {
    background: var(--surface-color);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 25px;
}

.favorites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.favorites-header h2 {
    font-size: 1.3rem;
    color: var(--accent-color);
}

.clear-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.clear-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.favorites-list::-webkit-scrollbar {
    width: 8px;
}

.favorites-list::-webkit-scrollbar-track {
    background: var(--surface-light);
    border-radius: 4px;
}

.favorites-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.empty-message {
    color: var(--text-secondary);
    text-align: center;
    padding: 20px;
    font-style: italic;
}

.favorite-item {
    background: var(--surface-light);
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    transition: var(--transition);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.favorite-item:hover {
    background: #2a4a7a;
}

.favorite-text {
    flex: 1;
    line-height: 1.5;
}

.favorite-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

.favorite-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.favorite-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
    background: var(--surface-color);
    color: var(--text-primary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.favorite-btn:hover {
    background: var(--secondary-color);
}

.favorite-btn.delete:hover {
    background: var(--primary-color);
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: auto;
    border-top: 1px solid var(--surface-light);
}

footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.powered-by a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.powered-by a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 600px) {
    .app-container {
        padding: 15px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .logo-container {
        flex-direction: column;
        gap: 10px;
    }

    .controls-section {
        padding: 20px;
    }

    .generate-btn {
        padding: 15px 25px;
        font-size: 1.1rem;
    }

    #insult-text {
        font-size: 1.2rem;
    }

    .insult-display {
        padding: 20px;
    }

    .action-btn {
        padding: 10px 18px;
        font-size: 0.9rem;
    }

    .favorites-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .favorite-item {
        flex-direction: column;
    }

    .favorite-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .severity-labels {
        font-size: 0.65rem;
    }
}

@media (max-width: 400px) {
    h1 {
        font-size: 1.5rem;
    }

    .tagline {
        font-size: 0.9rem;
    }

    .insult-actions {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.generate-btn:focus {
    animation: pulse 0.5s ease;
}

/* Severity level colors */
.severity-mild { color: #27ae60; }
.severity-light { color: #f1c40f; }
.severity-medium { color: #e67e22; }
.severity-spicy { color: #e74c3c; }
.severity-savage { color: #8e44ad; }
