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

:root {
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --shadow: rgba(99, 102, 241, 0.1);
    --border: #e5e7eb;
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent: #818cf8;
    --accent-hover: #6366f1;
    --shadow: rgba(129, 140, 248, 0.2);
    --border: #334155;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    background: var(--bg-secondary);
    border-radius: 24px;
    padding: 48px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 20px 60px var(--shadow);
    transition: all 0.3s ease;
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.theme-toggle {
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 20px;
    color: var(--text-primary);
}

.theme-toggle:hover {
    transform: rotate(180deg);
    border-color: var(--accent);
}

.text-display {
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    margin: 32px 0;
    text-align: center;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#text {
    font-size: 20px;
    line-height: 1.6;
    color: var(--text-primary);
    font-weight: 500;
    transition: font-size 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.size-indicator {
    text-align: center;
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
}

.size-value {
    color: var(--accent);
    font-size: 18px;
    font-weight: 700;
}

.controls {
    display: flex;
    gap: 16px;
    justify-content: center;
}

button {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow);
}

button:active {
    transform: translateY(0);
}

button i {
    font-size: 18px;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.reset-btn {
    margin-top: 16px;
    width: 100%;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 2px solid var(--border);
    justify-content: center;
}

.reset-btn:hover {
    background: var(--border);
}

@media (max-width: 640px) {
    .container {
        padding: 32px 24px;
    }

    h1 {
        font-size: 24px;
    }

    .text-display {
        padding: 30px 20px;
        min-height: 150px;
    }

    .controls {
        flex-direction: column;
    }

    button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 400px) {
    .container {
        padding: 24px 16px;
    }

    h1 {
        font-size: 20px;
    }

    .theme-toggle {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    button {
        padding: 14px 24px;
        font-size: 14px;
    }
}