html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  white-space: nowrap;
  line-height: 60px;
}

/* Transformer Design Specific Styles */

/* Color coding for Excel-like interface */
.input-parameter {
    background-color: #C3D69B !important; /* Green - Input Parameters */
    border-color: #A5C46A !important;
}

.input-parameter:focus {
    background-color: #B8D18A !important;
    border-color: #9BB85A !important;
    box-shadow: 0 0 0 0.2rem rgba(195, 214, 155, 0.25) !important;
}

.reference-parameter {
    background-color: #558ED5 !important; /* Blue - References to Input Parameters */
    color: white !important;
    border-color: #4A7BC8 !important;
}

.fixed-value {
    background-color: #FFC000 !important; /* Yellow/Orange - Fixed Values */
    border-color: #E6AC00 !important;
}

.calculated-value {
    background-color: #FF0000 !important; /* Red - Formula-Based Calculations */
    color: white !important;
    border-color: #E60000 !important;
}

.cross-reference {
    background-color: #8064A2 !important; /* Purple - References from Another Sheet */
    color: white !important;
    border-color: #6B5687 !important;
}

/* Table styles */
.calculation-table {
    font-size: 0.9em;
    border: 1px solid #dee2e6;
}

.calculation-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    text-align: center;
    border: 1px solid #dee2e6;
    padding: 8px;
}

.calculation-table td {
    text-align: center;
    vertical-align: middle;
    border: 1px solid #dee2e6;
    padding: 6px;
}

.calculation-table .text-start {
    text-align: left !important;
}

/* Section headers */
.section-header {
    background-color: #e9ecef;
    font-weight: bold;
    padding: 10px 15px;
    margin: 15px 0 10px 0;
    border-left: 4px solid #007bff;
    border-radius: 0 5px 5px 0;
}

/* Parameter groups */
.parameter-group {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    background-color: #fafafa;
}

.parameter-group h5 {
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 8px;
    margin-bottom: 15px;
    font-weight: 600;
}

.parameter-group h6 {
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 10px;
}

/* Readonly fields */
.readonly-field {
    background-color: #f8f9fa !important;
    border: 1px solid #ced4da !important;
    color: #6c757d !important;
}

/* Loading states */
.loading-spinner {
    display: none;
}

.btn-loading {
    position: relative;
}

.btn-loading .spinner-border {
    width: 1rem;
    height: 1rem;
}

/* Button styles */
.btn-calculate {
    background-color: #28a745;
    border-color: #28a745;
    font-weight: 500;
}

.btn-calculate:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.btn-calculate:focus {
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Alert styles */
.alert-calculation {
    border-left: 4px solid #17a2b8;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* CRGO specific styles */
.yoke-plate-table {
    font-size: 0.85em;
}

.yoke-plate-table input {
    width: 80px;
    font-size: 0.8em;
    padding: 4px 6px;
}

.yoke-plate-table th {
    background-color: #495057;
    color: white;
    font-size: 0.8em;
    padding: 8px 4px;
    text-align: center;
}

.yoke-plate-table td {
    padding: 4px;
    text-align: center;
    vertical-align: middle;
}

/* Chart styles */
.efficiency-chart {
    height: 400px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 10px;
}

/* Navigation styles */
.navbar-brand {
    font-weight: bold;
    font-size: 1.3rem;
}

.navbar-brand i {
    margin-right: 8px;
}

/* Main content */
.main-content {
    padding-top: 20px;
    min-height: calc(100vh - 200px);
}

/* Card styles */
.card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    padding: 12px 20px;
}

.card-header h5 {
    margin: 0;
    color: #495057;
}

.card-header i {
    margin-right: 8px;
    color: #007bff;
}

.card-body {
    padding: 20px;
}

/* Form styles */
.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 5px;
}

.form-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Table responsive */
.table-responsive {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.table-responsive .table {
    margin-bottom: 0;
}

/* Status indicators */
.status-draft {
    color: #6c757d;
    background-color: #f8f9fa;
}

.status-active {
    color: #155724;
    background-color: #d4edda;
}

.status-completed {
    color: #004085;
    background-color: #cce7ff;
}

.status-archived {
    color: #721c24;
    background-color: #f8d7da;
}

/* Sticky elements */
.sticky-top {
    top: 20px;
}

/* Hover effects */
.card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transition: box-shadow 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
    transition: transform 0.2s ease;
}

/* Validation styles */
.is-invalid {
    border-color: #dc3545 !important;
}

.is-invalid:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.875em;
    margin-top: 5px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-content {
        padding-top: 10px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .parameter-group {
        padding: 15px;
    }
    
    .btn-group .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.5rem;
    }
    
    .yoke-plate-table {
        font-size: 0.75em;
    }
    
    .yoke-plate-table input {
        width: 60px;
        font-size: 0.7em;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .card-header h5 {
        font-size: 1rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        margin-bottom: 5px;
        border-radius: 0.375rem !important;
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .card-footer,
    .alert {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .main-content {
        padding-top: 0 !important;
    }
}
