/* ============================================
   CALCULADORA DE PIÑONES - ESTILOS REACT
   ============================================ */

/* Variables CSS para fácil mantenimiento */
:root {
    --color-primary: #3498db;
    --color-primary-dark: #2980b9;
    --color-secondary: #95a5a6;
    --color-secondary-dark: #7f8c8d;
    --color-success: #2ecc71;
    --color-success-dark: #27ae60;
    --color-danger: #e74c3c;
    --color-warning: #ffc107;
    --color-warning-bg: #fff3cd;
    --color-warning-text: #856404;

    --color-text: #333;
    --color-text-light: #555;
    --color-text-muted: #7f8c8d;
    --color-heading: #2c3e50;

    --color-border: #ddd;
    --color-border-light: #eee;
    --color-bg-gray: #f8f9fa;
    --color-bg-disabled: #f5f5f5;

    --border-radius: 4px;
    --box-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --box-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);

    --font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

/* ============================================
   BASE STYLES
   ============================================ */

#calculadora-app body,
body {
    font-family: var(--font-family);
    color: var(--color-text);
    margin: 0;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-md);
    padding: 24px;
    margin-bottom: 20px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--color-border-light);
    padding-bottom: 10px;
}

/* ============================================
   FORM STYLES
   ============================================ */

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--color-text-light);
}

.form-control,
input.form-control,
select.form-control,
textarea.form-control,
input[type="text"],
input[type="number"],
select {
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: border 0.2s;
    box-sizing: border-box;
    width: 100%;
    background-color: white;
    font-family: var(--font-family);
    line-height: normal;
    height: auto;
    margin: 0;
}

.form-control:focus,
input.form-control:focus,
select.form-control:focus,
input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: none;
}

.form-control:disabled,
input.form-control:disabled,
select.form-control:disabled {
    background-color: var(--color-bg-disabled);
    cursor: not-allowed;
    opacity: 0.6;
}

.error-message {
    color: var(--color-danger);
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
}

.alert-warning {
    background-color: var(--color-warning-bg);
    border: 1px solid var(--color-warning);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    margin: 10px 0;
    color: var(--color-warning-text);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-warning::before {
    content: "⚠️";
    font-size: 16px;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    line-height: normal;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    color: white;
}

.btn-secondary {
    background-color: var(--color-secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--color-secondary-dark);
    color: white;
}

.btn-success {
    background-color: var(--color-success);
    color: white;
}

.btn-success:hover {
    background-color: var(--color-success-dark);
    color: white;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* ============================================
   RESULTS & TABLES
   ============================================ */

.results-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    align-items: start;
}

.table-container {
    overflow-x: auto;
}

.params-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    border: none;
}

.params-table th,
.params-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
    border-left: none;
    border-right: none;
    border-top: none;
}

.params-table th {
    background-color: var(--color-bg-gray);
    font-weight: 600;
    color: #444;
    width: 45%;
}

.params-table tr:last-child td {
    border-bottom: none;
}

.params-table .section-header {
    background-color: #e9ecef;
    font-weight: bold;
    text-align: center;
    color: #495057;
}

/* ============================================
   CANVAS
   ============================================ */

canvas {
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    background: white;
    box-shadow: var(--box-shadow-sm);
    width: 100%;
    height: auto;
}

/* ============================================
   HEADER
   ============================================ */

.header-brand {
    text-align: center;
    margin-bottom: 30px;
}

.header-brand h1 {
    color: var(--color-heading);
    margin: 0 0 10px 0;
}

.header-brand p {
    color: var(--color-text-muted);
    margin: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    body {
        background-color: white;
    }

    .app-container {
        width: 100%;
        max-width: none;
        padding: 0;
    }

    .card {
        box-shadow: none;
        padding: 0;
        margin-bottom: 20px;
        border: none;
    }

    .form-grid,
    .section-title,
    .header-brand p,
    button,
    .no-print {
        display: none;
    }

    .results-grid {
        display: block;
    }

    .table-container {
        margin-bottom: 20px;
        page-break-inside: avoid;
    }

    canvas {
        border: 1px solid #000;
        max-height: 500px;
        width: auto;
        margin: 0 auto;
        display: block;
    }

    .header-brand h1 {
        font-size: 20px;
        border-bottom: 1px solid #000;
        padding-bottom: 10px;
    }

    table,
    th,
    td {
        border: none;
        border-collapse: collapse;
    }

    .params-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 14px;
        border: none;
    }

    .params-table th,
    .params-table td {
        padding: 10px 12px;
        text-align: left;
        border-bottom: 1px solid #eee;
        border-left: none;
        border-right: none;
        border-top: none;
    }

    .params-table th {
        background-color: #f8f9fa;
        font-weight: 600;
        color: #444;
        width: 45%;
    }

    .params-table tr:last-child td {
        border-bottom: none;
    }

    .params-table .section-header {
        background-color: #e9ecef;
        font-weight: bold;
        text-align: center;
        color: #495057;
        border: none;
    }

    img {
        max-width: 100%;
        height: auto;
    }
}