/* styles.css - Стили для калькулятора токарных работ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.2em;
    font-weight: 300;
}

.calculator {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.input-section, .results-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h2 {
    color: #34495e;
    margin-bottom: 20px;
    font-size: 1.4em;
    font-weight: 400;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #3498db;
}

button {
    width: 100%;
    padding: 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

button:hover {
    background-color: #2980b9;
}

button:active {
    background-color: #21618c;
}

.result-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.result-group:last-child {
    border-bottom: none;
}

.result-group label {
    font-weight: 500;
    color: #555;
    flex: 1;
}

.result-group span {
    font-weight: 600;
    color: #2c3e50;
    background-color: #ecf0f1;
    padding: 8px 12px;
    border-radius: 4px;
    min-width: 120px;
    text-align: center;
}

.machine-specs {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.machine-specs h3 {
    color: #34495e;
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: 500;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.spec-item {
    padding: 12px;
    background-color: #f8f9fa;
    border-left: 4px solid #3498db;
    border-radius: 0 4px 4px 0;
}

.spec-item strong {
    color: #2c3e50;
}

.warning {
    margin-top: 20px;
    padding: 15px;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-left: 4px solid #f39c12;
    border-radius: 4px;
    color: #856404;
}

.warning strong {
    color: #b7950b;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }
    
    .calculator {
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .calculator {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.8em;
        margin-bottom: 20px;
    }
    
    .input-section, .results-section, .machine-specs {
        padding: 20px;
    }
    
    .specs-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    button {
        padding: 18px;
        font-size: 18px;
    }
}

@media (max-width: 640px) {
    .input-section, .results-section, .machine-specs {
        padding: 15px;
    }
    
    h2 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }
    
    .input-group input,
    .input-group select {
        padding: 14px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
    }
    
    h1 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }
    
    .calculator {
        gap: 15px;
    }
    
    .input-section, .results-section, .machine-specs {
        padding: 12px;
    }
    
    .result-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 0;
    }
    
    .result-group label {
        font-size: 14px;
    }
    
    .result-group span {
        width: 100%;
        min-width: auto;
        font-size: 14px;
        padding: 10px;
    }
    
    .input-group {
        margin-bottom: 15px;
    }
    
    .input-group label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .input-group input,
    .input-group select {
        padding: 12px;
        font-size: 16px;
    }
    
    button {
        padding: 16px;
        font-size: 16px;
    }
    
    .spec-item {
        padding: 10px;
        font-size: 14px;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 5px;
    }
    
    h1 {
        font-size: 1.3em;
        margin-bottom: 12px;
    }
    
    .input-section, .results-section, .machine-specs {
        padding: 10px;
    }
    
    .input-group input,
    .input-group select {
        padding: 10px;
        font-size: 14px;
    }
    
    button {
        padding: 14px;
        font-size: 14px;
    }
    
    .result-group span {
        font-size: 13px;
        padding: 8px;
    }
    
    .spec-item {
        padding: 8px;
        font-size: 13px;
    }
    
    .warning {
        padding: 10px;
        font-size: 13px;
    }
}

/* Landscape orientation для мобильных */
@media (max-height: 500px) and (orientation: landscape) {
    .calculator {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.4em;
        margin-bottom: 10px;
    }
    
    .input-section, .results-section {
        padding: 15px;
    }
    
    .machine-specs {
        grid-column: 1 / -1;
        padding: 15px;
    }
}

/* Touch-friendly элементы */
@media (pointer: coarse) {
    .input-group input,
    .input-group select,
    button {
        min-height: 44px;
    }
    
    button {
        padding: 16px;
        font-size: 16px;
    }
}

/* Анимации */
.result-group span {
    transition: all 0.3s ease;
}

.calculator {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Улучшение читаемости */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}
