/* Base Styles */
:root {
    --primary-color: #4a6fa5;
    --secondary-color: #6c757d;
    --accent-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --success-color: #28a745;
    --error-color: #dc3545;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

.converter-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    padding: 25px;
    overflow: hidden;
}

h1, h2 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
}

h2 {
    margin-top: 30px;
    font-size: 1.5rem;
}

/* Input Section */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-method {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--primary-color);
}

.input-method button {
    padding: 10px 15px;
    border: none;
    background: white;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.input-method button.active {
    background: var(--primary-color);
    color: white;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dimension-row, .area-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.dimension-row label, .area-row label {
    flex: 1 0 100px;
    font-weight: 600;
}

.dimension-row input, .area-row input {
    flex: 2 0 150px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.dimension-row select, .area-row select {
    flex: 1 0 100px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    background-color: white;
}

.calculate-btn {
    align-self: flex-end;
    padding: 10px 20px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

.calculate-btn:hover {
    background-color: #138496;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.primary-btn {
    padding: 12px 25px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.primary-btn:hover {
    background-color: #3a5a8a;
}

.secondary-btn {
    padding: 12px 25px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.secondary-btn:hover {
    background-color: #5a6268;
}

/* Results Section */
.results-section {
    margin-top: 30px;
}

.results-container {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    background-color: var(--light-color);
    position: relative;
}

.info-message {
    color: var(--secondary-color);
    font-style: italic;
    text-align: center;
}

.result-group {
    margin-bottom: 15px;
}

.result-group h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px dashed #ddd;
}

.result-item:last-child {
    border-bottom: none;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    background-color: var(--light-color);
    border: 1px solid var(--secondary-color);
    border-radius: 3px;
    color: var(--secondary-color);
    cursor: pointer;
    transition: all 0.3s;
}

.copy-btn:hover {
    background-color: var(--secondary-color);
    color: white;
}

.copy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.copy-btn:disabled:hover {
    background-color: var(--light-color);
    color: var(--secondary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .converter-container {
        padding: 15px;
    }
    
    .dimension-row, .area-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dimension-row label, .area-row label {
        flex: 1 0 100%;
        margin-bottom: 5px;
    }
    
    .dimension-row input, .dimension-row select,
    .area-row input, .area-row select {
        flex: 1 0 100%;
        width: 100%;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .primary-btn, .secondary-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .input-method {
        flex-direction: column;
    }
    
    .input-method button {
        width: 100%;
        border-radius: 0;
    }
    
    .input-method button:first-child {
        border-radius: 5px 5px 0 0;
    }
    
    .input-method button:last-child {
        border-radius: 0 0 5px 5px;
    }
}

.hidden {
    display: none;
}