:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #e74c3c;
    --background: #ecf0f1;
    --text: #2c3e50;
    --button-bg: #ffffff;
    --button-text: #333333;
    --operator-bg: #f8f9fa;
    --equals-bg: #3498db;
    --equals-text: #ffffff;
    --shadow: rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --primary: #1a1a1a;
    --secondary: #2980b9;
    --background: #121212;
    --text: #ffffff;
    --button-bg: #333333;
    --button-text: #ffffff;
    --operator-bg: #404040;
    --equals-bg: #2980b9;
    --equals-text: #ffffff;
    --shadow: rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background: var(--background);
    color: var(--text);
}
.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    width: 100%;
}

.container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    gap: 20px;
    padding: 20px;
}

.calculator {
    background: var(--primary);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px var(--shadow);
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    transition: var(--transition);
}

.display {
    background: var(--primary);
    padding: 20px;
    position: relative;
}

.display-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.display button {
    background: transparent;
    border: none;
    color: #f8f9fa;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: var(--transition);
}

.display button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.history {
    color: #f8f9fa;
    opacity: 0.7;
    font-size: 0.9em;
    min-height: 20px;
    margin-bottom: 10px;
}

#result {
    width: 100%;
    background: transparent;
    border: none;
    color: #f8f9fa;
    font-size: 2.5em;
    text-align: right;
    outline: none;
}

.advanced-functions {
    display: none;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--operator-bg);
    padding: 10px;
}

.advanced-functions.active {
    display: grid;
}

.advanced-functions button {
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    padding: 15px;
    font-size: 1em;
    cursor: pointer;
    transition: var(--transition);
}

.advanced-functions button:hover {
    background: var(--secondary);
    color: var(--equals-text);
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--operator-bg);
    padding: 10px;
}

/* Стили для кнопки "Горячие клавиши" */
.hotkeys-toggle {
    background: transparent;
    border: none;
    color: var(--calculator-text);
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: var(--transition);
}

.hotkeys-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Стили для всплывающего окна */
.hotkeys-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.hotkeys-popup.active {
    display: flex;
}

.hotkeys-content {
    background: #e0e3e3;;
    color: var(--button-text);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px var(--shadow);
    max-width: 300px;
    width: 100%;
    position: relative;
}

.hotkeys-content h3 {
    margin-bottom: 15px;
    font-size: 1.2em;
}

.hotkeys-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hotkeys-content li {
    margin-bottom: 10px;
    font-size: 0.9em;
}

.close-hotkeys {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: #691414;
    cursor: pointer;
    font-size: 1.2em;
    padding: 5px;
    border-radius: 5px;
    transition: var(--transition);
}

.close-hotkeys:hover {
    color:  #f70808;
}

button {
    border: none;
    padding: 20px;
    font-size: 1.2em;
    cursor: pointer;
    transition: var(--transition);
    background: var(--button-bg);
    color: var(--button-text);
}

button:hover {
    background: var(--secondary);
    color: var(--equals-text);
}

.operator {
    background: var(--operator-bg);
    color: var(--secondary);
}

.equals {
    background: var(--equals-bg);
    color: var(--equals-text);
    grid-column: span 2;
}

.clear {
    background: var(--accent);
    color: var(--equals-text);
}

.steps {
    display: none;
    background: var(--button-bg);
    padding: 15px;
    border-top: 1px solid var(--operator-bg);
}

.steps.active {
    display: block;
    animation: slideDown 0.3s ease;
}

.steps-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.steps-content {
    font-size: 0.9em;
    color: var(--text);
}
.calculator-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.memory-display, .history-list {
    background: var(--button-bg);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px var(--shadow);
}

.history-list ul {
    list-style: none;
    margin-top: 10px;
}

.history-list li {
    padding: 5px 0;
    border-bottom: 1px solid var(--operator-bg);
}

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--secondary);
    color: var(--equals-text);
    padding: 10px 20px;
    border-radius: var(--border-radius);
    display: none;
    animation: slideIn 0.3s ease;
}

footer {
    width: 100%; 
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
    z-index: 100;
    margin-top: auto; 
}



.github-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
    transition: 0.3s;
    padding: 8px 20px;
    border-radius: 30px;
    background: rgba(255,255,255,0.1);
    font-size: 16px;
}

.github-link:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.2);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.github-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.5s ease;
}

.github-link:hover .github-icon {
    transform: rotate(360deg);
}


/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Media Queries */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .calculator {
        max-width: 100%;
    }
    
    button {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .advanced-functions button,
    .buttons button {
        font-size: 1em;
        padding: 12px;
    }
    
    #result {
        font-size: 2em;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Print styles */
@media print {
    .calculator {
        box-shadow: none;
    }
    
    .buttons,
    .advanced-functions {
        display: none;
    }
}
