/* Calculator Tool Styles */

/* Tool Header */
.tool-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 4rem 0 2rem;
    margin-top: 80px;
}

.tool-header-content {
    text-align: center;
}

.tool-header-text h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.tool-header-text h1 i {
    font-size: 2rem;
}

.tool-header-text p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.tool-header-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Calculator Section */
.calculator-section {
    padding: 4rem 0;
}

.calculator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
}

.calculator-form {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
}

.calculator-form h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--light);
    text-align: center;
}

.calculator-form .form-group {
    margin-bottom: 1.5rem;
}

.calculator-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--light);
    font-weight: 500;
}

.calculator-form input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--light);
    font-size: 16px;
    transition: all 0.3s ease;
}

.calculator-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.calculator-form input::placeholder {
    color: var(--gray-light);
}

.calculate-btn {
    width: 100%;
    margin-bottom: 1rem;
    padding: 1rem;
    font-size: 1.1rem;
}

.reset-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
}

/* Calculator Results */
.calculator-results {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
    min-height: 300px;
}

.calculator-results h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--light);
    text-align: center;
}

.results-placeholder {
    text-align: center;
    color: var(--gray-light);
    padding: 2rem;
}

.results-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--gray);
}

.result-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary);
}

.result-item h4 {
    color: var(--light);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.result-item .value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.result-item .description {
    color: var(--gray-light);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Information Section */
.info-section {
    padding: 4rem 0;
    background: rgba(255, 255, 255, 0.02);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.info-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.info-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.info-icon i {
    font-size: 1.5rem;
    color: white;
}

.info-card h3 {
    color: var(--light);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.info-card p {
    color: var(--gray-light);
    line-height: 1.6;
}

/* Tips Section */
.tips-section {
    padding: 4rem 0;
}

.tips-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--light);
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.tip-item i {
    color: var(--primary);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.tip-item span {
    color: var(--light);
    font-size: 1rem;
}

/* Light Theme Adjustments */
body.light-theme .calculator-form,
body.light-theme .calculator-results,
body.light-theme .info-card {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .calculator-form input {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.2);
    color: var(--dark);
}

body.light-theme .calculator-form input::placeholder {
    color: var(--gray);
}

body.light-theme .calculator-form label,
body.light-theme .calculator-form h2,
body.light-theme .calculator-results h3,
body.light-theme .info-card h3,
body.light-theme .tip-item span {
    color: var(--dark);
}

body.light-theme .info-card p {
    color: var(--gray);
}

body.light-theme .results-placeholder {
    color: var(--gray);
}

body.light-theme .result-item {
    background: rgba(0, 0, 0, 0.05);
}

body.light-theme .result-item h4 {
    color: var(--dark);
}

body.light-theme .result-item .description {
    color: var(--gray);
}

body.light-theme .tip-item {
    background: rgba(0, 0, 0, 0.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .calculator-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .tool-header-text h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tool-header-text h1 i {
        font-size: 1.5rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
    }
    
    .calculator-form,
    .calculator-results {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .tool-header {
        padding: 3rem 0 1.5rem;
    }
    
    .tool-header-text h1 {
        font-size: 1.8rem;
    }
    
    .tool-header-text p {
        font-size: 1rem;
    }
    
    .calculator-form h2 {
        font-size: 1.5rem;
    }
    
    .calculator-results h3 {
        font-size: 1.3rem;
    }
    
    .info-card {
        padding: 1.5rem;
    }
    
    .tip-item {
        padding: 0.75rem;
    }
}

/* Animation for calculator results */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.result-item {
    animation: slideInRight 0.5s ease forwards;
}

.result-item:nth-child(1) { animation-delay: 0.1s; }
.result-item:nth-child(2) { animation-delay: 0.2s; }
.result-item:nth-child(3) { animation-delay: 0.3s; }
.result-item:nth-child(4) { animation-delay: 0.4s; }

/* Error states */
.form-group.error input {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.error-message {
    color: #ef4444;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Success states */
.form-group.success input {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* Loading state */
.calculate-btn.loading {
    position: relative;
    color: transparent;
}

.calculate-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ECU Map Generator Specific Styles */

/* Input Mode Toggle */
.input-mode-toggle {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.mode-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mode-btn:hover {
    background: var(--primary);
    color: white;
}

.mode-btn.active {
    background: var(--primary);
    color: white;
}

/* Unit Toggle Section */
.unit-toggle-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.unit-toggle-section h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.unit-toggle-section h2 i {
    color: var(--primary);
}

.unit-toggle {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.unit-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.unit-btn:hover {
    background: var(--primary);
    color: white;
}

.unit-btn.active {
    background: var(--primary);
    color: white;
}

/* Input Help Text */
.input-help {
    color: var(--gray-light);
    font-size: 0.85rem;
    margin-top: 0.25rem;
    font-style: italic;
}

/* Input Sections */
.input-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.input-section h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-section h2 i {
    color: var(--primary);
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    margin-bottom: 0.5rem;
    color: var(--light);
    font-weight: 500;
}

.input-group input,
.input-group select {
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: var(--light);
    font-size: 16px;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.input-group input::placeholder {
    color: var(--gray-light);
}

/* Dropdown styling for better readability */
.input-group select option {
    background: rgba(0, 0, 0, 0.9);
    color: var(--light);
    padding: 8px;
}

body.light-theme .input-group select option {
    background: rgba(255, 255, 255, 0.95);
    color: var(--dark);
}

/* Map Configuration */
.map-config-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.map-config-section h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.map-config-section h2 i {
    color: var(--primary);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

/* Results Section */
.results-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.results-section h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.results-section h2 i {
    color: var(--primary);
}

/* Map Tabs */
.map-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    overflow-x: auto;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--gray-light);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Map Container */
.map-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    min-height: 400px;
    position: relative;
    overflow: hidden;
}

.map-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Map Table */
.map-table {
    width: 100%;
    overflow-x: auto;
    position: relative;
    display: block;
}

.map-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    transition: transform 0.3s ease;
    min-width: 100%;
    table-layout: fixed;
}

.map-table th,
.map-table td {
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem;
    text-align: center;
    min-width: 40px;
    white-space: nowrap;
    overflow: visible;
    font-weight: bold;
    text-shadow: 0 0 1px rgba(0,0,0,0.5);
    transition: all 0.2s ease;
}

.map-table th {
    background: rgba(255, 255, 255, 0.15);
    color: var(--light);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    text-shadow: 0 0 2px rgba(0,0,0,0.8);
}

.map-table .load-label {
    background: rgba(255, 255, 255, 0.15);
    color: var(--light);
    font-weight: 600;
    position: sticky;
    left: 0;
    z-index: 5;
    text-shadow: 0 0 2px rgba(0,0,0,0.8);
}

.map-table td:not(.load-label) {
    font-weight: bold;
    transition: all 0.2s ease;
}

.map-table td:not(.load-label):hover {
    transform: scale(1.1);
    z-index: 15;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Map Info */
.map-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1.5rem;
}

.map-info h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--light);
}

.map-info p {
    color: var(--gray-light);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.map-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.stat-label {
    color: var(--gray-light);
    font-size: 0.9rem;
}

.stat-value {
    color: var(--primary);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Export Options */
.export-options {
    text-align: center;
}

.export-options h3 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: var(--light);
}

.export-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.export-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: left;
}

.export-info h4 {
    color: var(--light);
    margin-bottom: 1rem;
}

.export-info ul {
    color: var(--gray-light);
    line-height: 1.6;
}

.export-info li {
    margin-bottom: 0.5rem;
}

/* Information Section */
.info-section {
    margin-top: 3rem;
}

.info-section h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-section h2 i {
    color: var(--primary);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.info-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.info-card h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-card h3 i {
    color: var(--primary);
}

.info-card p {
    color: var(--gray-light);
    line-height: 1.6;
}

/* Light Theme Adjustments */
body.light-theme .input-section,
body.light-theme .map-config-section,
body.light-theme .results-section {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .input-group input,
body.light-theme .input-group select {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.2);
    color: var(--dark);
}

body.light-theme .input-group input::placeholder {
    color: var(--gray);
}

body.light-theme .map-container {
    background: rgba(0, 0, 0, 0.1);
}

body.light-theme .map-info,
body.light-theme .export-info,
body.light-theme .info-card {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .stat {
    background: rgba(0, 0, 0, 0.05);
}

body.light-theme .map-table th,
body.light-theme .map-table td {
    text-shadow: 0 0 2px rgba(255,255,255,0.8);
}

body.light-theme .map-table th {
    background: rgba(0, 0, 0, 0.1);
    color: var(--dark);
}

body.light-theme .map-table .load-label {
    background: rgba(0, 0, 0, 0.1);
    color: var(--dark);
}

/* Responsive Design */
@media (max-width: 768px) {
    .input-mode-toggle {
        flex-direction: column;
        align-items: center;
    }
    
    .input-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .map-tabs {
        flex-wrap: wrap;
    }
    
    .export-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .map-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .input-section,
    .map-config-section,
    .results-section {
        padding: 1.5rem;
    }
    
    .input-section h2,
    .map-config-section h2,
    .results-section h2 {
        font-size: 1.5rem;
    }
    
    .map-container {
        min-height: 300px;
    }
    
    .map-table {
        font-size: 0.8rem;
    }
    
    .map-table th,
    .map-table td {
        padding: 0.3rem;
        min-width: 30px;
        overflow: visible;
    }
    
    .tab-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
} 