* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --tertiary-color: #f093fb;
    --bg-color: #0d1117;
    --surface-color: #161b22;
    --surface-light: #21262d;
    --text-color: #c9d1d9;
    --text-bright: #f0f6fc;
    --text-muted: #8b949e;
    --accent-color: #58a6ff;
    --danger-color: #f85149;
    --success-color: #3fb950;
    --border-color: rgba(48, 54, 61, 0.6);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, var(--bg-color) 0%, #2d333b 50%, var(--secondary-color) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    color: var(--text-color);
    position: relative;
    overflow-x: hidden;
}

/* Background Logo */
.background-logo {
    position: fixed;
    width: 400px;
    height: 400px;
    opacity: 0.04;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
    color: #3b82f6;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translate(-50%, -50%) translateY(0px) rotate(0deg);
    }
    50% {
        transform: translate(-50%, -50%) translateY(-30px) rotate(5deg);
    }
}

/* Main Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: linear-gradient(135deg, rgba(13, 17, 23, 0.8), rgba(33, 38, 45, 0.6));
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 101;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
    background: rgba(59, 130, 246, 0.1);
    padding: 6px;
}

.app-title {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-color), var(--tertiary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    letter-spacing: -0.5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-btn {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background: linear-gradient(135deg, var(--surface-light), rgba(33, 38, 45, 0.6));
    color: var(--text-bright);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.header-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.header-btn:hover {
    transform: translateY(-2px);
    border-color: var(--accent-color);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.1));
}

.header-btn:hover::before {
    left: 100%;
}

.header-btn:active {
    transform: translateY(0);
}

/* Settings Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: none;
    z-index: 500;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.settings-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: linear-gradient(135deg, var(--surface-color) 0%, var(--surface-light) 100%);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 501;
    display: none;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

.settings-modal.active {
    display: flex;
    flex-direction: column;
}

@keyframes slideIn {
    from {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.settings-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid var(--border-color);
}

.settings-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-bright);
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(255, 0, 0, 0.1);
    color: var(--danger-color);
}

.settings-body {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-bright);
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.logo-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.05));
    border: 2px dashed rgba(59, 130, 246, 0.4);
    border-radius: 12px;
    margin: 0 auto 15px;
    position: relative;
}

.logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-placeholder {
    font-size: 48px;
    opacity: 0.5;
}

.upload-area {
    border: 2px dashed var(--accent-color);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    background: rgba(59, 130, 246, 0.05);
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.upload-area:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: #60a5fa;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

.upload-area:active {
    background: rgba(59, 130, 246, 0.15);
}

.upload-area.drag-over {
    background: rgba(59, 130, 246, 0.2);
    border-color: #60a5fa;
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
}

.upload-area p {
    margin: 0;
    color: var(--text-bright);
    font-weight: 500;
}

.upload-info {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 15px;
}

.settings-input {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.05));
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    color: var(--text-bright);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.settings-input:focus {
    outline: none;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.1));
    border-color: #60a5fa;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.btn-secondary {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(248, 81, 73, 0.08));
    border: 1.5px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: var(--danger-color);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(248, 81, 73, 0.15));
    border-color: var(--danger-color);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.settings-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Light Theme - Settings */
body.light-theme .header-btn {
    border: 2px solid #d0d7e8;
    background: linear-gradient(135deg, #f0f2f5, rgba(240, 242, 245, 0.8));
    color: #1a202c;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

body.light-theme .header-btn:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.08));
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

body.light-theme .settings-modal {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

body.light-theme .settings-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-theme .settings-header h3 {
    color: #1a202c;
}

body.light-theme .settings-body {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body.light-theme .settings-section h4 {
    color: #1a202c;
}

body.light-theme .upload-area {
    border: 2px dashed #93c5fd;
    background: rgba(147, 197, 253, 0.1);
    color: #1a202c;
}

body.light-theme .upload-area:hover {
    background: rgba(147, 197, 253, 0.15);
    border-color: #60a5fa;
}

body.light-theme .settings-input {
    background: linear-gradient(135deg, rgba(147, 197, 253, 0.15), rgba(191, 219, 254, 0.1));
    border: 1px solid #93c5fd;
    color: #1a202c;
}

body.light-theme .settings-input:focus {
    background: linear-gradient(135deg, rgba(147, 197, 253, 0.2), rgba(191, 219, 254, 0.15));
    border-color: #60a5fa;
}

body.light-theme .settings-footer {
    background: rgba(0, 0, 0, 0.05);
}

body.light-theme .notification {
    background: linear-gradient(135deg, #3fb950, #238636);
}

.theme-toggle {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background: linear-gradient(135deg, var(--surface-light), rgba(33, 38, 45, 0.6));
    color: var(--text-bright);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    border-color: var(--accent-color);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.1));
}

.theme-toggle:hover::before {
    left: 100%;
}

.theme-toggle:active {
    transform: translateY(0);
}

.theme-icon {
    transition: transform 0.3s ease;
    display: inline-block;
}

.theme-toggle:active .theme-icon {
    transform: rotate(180deg);
}
body.light-theme {
    --bg-color: #f5f7fa;
    --surface-color: #ffffff;
    --surface-light: #f0f2f5;
    --text-color: #2c3e50;
    --text-bright: #1a202c;
    --text-muted: #718096;
    --border-color: rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #f5f7fa 0%, #e8eaef 50%, #f0e8ff 100%);
}

body.light-theme .background-logo {
    color: #667eea;
    opacity: 0.05;
}

body.light-theme .main-header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(240, 242, 245, 0.9));
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

body.light-theme .calculator {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

body.light-theme .calculator:hover {
    box-shadow: 0 15px 50px rgba(102, 126, 234, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

body.light-theme .display-input {
    background: linear-gradient(135deg, rgba(245, 247, 250, 0.8), rgba(240, 242, 245, 0.6));
    border: 2px solid #e0e7ff;
    color: #1a202c;
}

body.light-theme .display-input:focus {
    background: linear-gradient(135deg, rgba(245, 247, 250, 0.95), rgba(240, 242, 245, 0.85));
    border-color: #667eea;
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.25), inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.light-theme .btn {
    background: linear-gradient(135deg, rgba(191, 219, 254, 0.4), rgba(219, 234, 254, 0.3));
    border: 1px solid #93c5fd;
    color: #1a202c;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.1);
}

body.light-theme .btn:hover {
    background: linear-gradient(135deg, rgba(147, 197, 253, 0.3), rgba(191, 219, 254, 0.25));
    border-color: #60a5fa;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.2);
}

body.light-theme .btn-function {
    background: linear-gradient(135deg, rgba(147, 197, 253, 0.2), rgba(191, 219, 254, 0.15));
    border: 1.5px solid #93c5fd;
    color: #2563eb;
}

body.light-theme .btn-function:hover {
    background: linear-gradient(135deg, rgba(147, 197, 253, 0.35), rgba(191, 219, 254, 0.28));
    border-color: #60a5fa;
}

body.light-theme .btn-operator {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

body.light-theme .btn-equals {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
}

body.light-theme .history {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

body.light-theme .history:hover {
    box-shadow: 0 15px 50px rgba(102, 126, 234, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

body.light-theme .history-item {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.05));
    border: 1px solid rgba(102, 126, 234, 0.2);
}

body.light-theme .history-item:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.1));
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

body.light-theme .btn-clear-history {
    background: linear-gradient(135deg, rgba(248, 81, 73, 0.12), rgba(248, 81, 73, 0.08));
    border: 1.5px solid rgba(248, 81, 73, 0.3);
    color: #d32f2f;
}

body.light-theme .btn-clear-history:hover {
    background: linear-gradient(135deg, rgba(248, 81, 73, 0.2), rgba(248, 81, 73, 0.15));
    box-shadow: 0 6px 15px rgba(248, 81, 73, 0.2);
}

body.light-theme .theme-toggle {
    border: 2px solid #d0d7e8;
    background: linear-gradient(135deg, #f0f2f5, rgba(240, 242, 245, 0.8));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

body.light-theme .theme-toggle:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.08));
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

body.light-theme #history-list::-webkit-scrollbar-track {
    background: rgba(102, 126, 234, 0.08);
}

body.light-theme #history-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #667eea, #764ba2);
}

body.light-theme .container {
    padding: 20px;
}

.container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 1000px;
    width: 100%;
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

/* Calculator */
.calculator {
    background: linear-gradient(135deg, var(--surface-color) 0%, var(--surface-light) 100%);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.calculator:hover {
    box-shadow: 0 25px 70px rgba(102, 126, 234, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-color), var(--tertiary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.display {
    margin-bottom: 35px;
}

.display-input {
    width: 100%;
    padding: 24px;
    font-size: 32px;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(13, 17, 23, 0.5), rgba(33, 38, 45, 0.3));
    border: 2px solid var(--border-color);
    border-radius: 14px;
    color: var(--text-bright);
    text-align: right;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.display-input:focus {
    outline: none;
    background: linear-gradient(135deg, rgba(13, 17, 23, 0.7), rgba(33, 38, 45, 0.5));
    border-color: var(--accent-color);
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.4), inset 0 1px 3px rgba(255, 255, 255, 0.1);
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.btn {
    padding: 20px;
    font-size: 18px;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.1));
    color: var(--text-bright);
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.2);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.btn:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(37, 99, 235, 0.25));
    border-color: #3b82f6;
    box-shadow: 0 12px 25px rgba(59, 130, 246, 0.4);
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.btn-function {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.15));
    color: #60a5fa;
    border: 1.5px solid rgba(59, 130, 246, 0.5);
}

.btn-function:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.35), rgba(37, 99, 235, 0.28));
    border-color: #60a5fa;
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.4);
}

.btn-operator {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
}

.btn-operator:hover {
    box-shadow: 0 12px 35px rgba(59, 130, 246, 0.6);
}

.btn-zero {
    grid-column: span 2;
}

.btn-equals {
    grid-column: span 2;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
}

.btn-equals:hover {
    box-shadow: 0 12px 35px rgba(37, 99, 235, 0.6);
}

/* History */
.history {
    background: linear-gradient(135deg, var(--surface-color) 0%, var(--surface-light) 100%);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.history:hover {
    box-shadow: 0 25px 70px rgba(102, 126, 234, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.history h3 {
    font-size: 22px;
    margin-bottom: 25px;
    background: linear-gradient(135deg, var(--accent-color), var(--tertiary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: -0.3px;
}

#history-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    max-height: 450px;
    padding-right: 8px;
}

.history-item {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
    padding: 14px 16px;
    margin-bottom: 10px;
    border-radius: 10px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-left: 3px solid var(--accent-color);
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.history-item:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.12));
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateX(4px);
}

.history-item-expression {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

.history-item-result {
    color: var(--success-color);
    font-weight: 700;
    margin-top: 6px;
    font-size: 15px;
}

.btn-clear-history {
    padding: 12px;
    background: linear-gradient(135deg, rgba(248, 81, 73, 0.1), rgba(248, 81, 73, 0.05));
    color: var(--danger-color);
    border: 1.5px solid rgba(248, 81, 73, 0.3);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-clear-history:hover {
    background: linear-gradient(135deg, rgba(248, 81, 73, 0.2), rgba(248, 81, 73, 0.12));
    border-color: var(--danger-color);
    box-shadow: 0 6px 20px rgba(248, 81, 73, 0.3);
    transform: translateY(-2px);
}

.btn-clear-history:active {
    transform: translateY(0);
}

/* Scrollbar */
#history-list::-webkit-scrollbar {
    width: 6px;
}

#history-list::-webkit-scrollbar-track {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
}

#history-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    transition: all 0.3s ease;
}

#history-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-color), var(--tertiary-color));
}

/* Notification */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    font-weight: 500;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

/* Responsive */
@media (max-width: 768px) {
    .main-header {
        padding: 15px 20px;
    }

    .app-title {
        font-size: 22px;
    }

    .theme-toggle {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }

    .container {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 25px;
    }

    .calculator {
        padding: 30px;
    }

    .header h1 {
        font-size: 28px;
    }

    .display-input {
        font-size: 26px;
        padding: 18px;
    }

    .btn {
        padding: 16px;
        font-size: 16px;
    }

    .history {
        padding: 30px;
    }

    .history h3 {
        font-size: 20px;
    }

    #history-list {
        max-height: 350px;
    }

    .header-logo {
        width: 35px;
        height: 35px;
    }

    .header-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .settings-modal {
        width: 95%;
        max-width: 450px;
    }

    .logo-preview {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 480px) {
    .main-header {
        padding: 12px 15px;
    }

    .app-title {
        font-size: 20px;
    }

    .theme-toggle {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .buttons {
        gap: 10px;
    }

    .btn {
        padding: 14px;
        font-size: 14px;
    }

    .display-input {
        font-size: 22px;
        padding: 14px;
    }

    .header h1 {
        font-size: 24px;
    }

    .calculator {
        padding: 20px;
    }

    .history {
        padding: 20px;
    }

    .history h3 {
        font-size: 18px;
    }

    #history-list {
        max-height: 250px;
    }

    .container {
        padding: 15px;
        gap: 20px;
    }

    .header-logo {
        width: 30px;
        height: 30px;
    }

    .header-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .settings-modal {
        width: 98%;
        max-width: none;
        max-height: 95vh;
    }

    .settings-header {
        padding: 20px;
    }

    .settings-body {
        padding: 20px;
    }

    .settings-footer {
        padding: 15px 20px;
    }

    .logo-preview {
        width: 90px;
        height: 90px;
    }

    .logo-placeholder {
        font-size: 40px;
    }

    .notification {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: calc(100% - 20px);
    }
}
