/* Energy Calculator Tool Styles */

/* Tool Container - Full Page Layout */
.energy-calculator-tool {
    width: 100%;
    min-height: 100vh;
    background: #ffffff;
    padding: 0;
    margin: 0;
}

.tool-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

/* Tool Header */
.tool-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
}

.tool-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.tool-header h1 i {
    color: var(--primary-color);
    font-size: 1.8rem;
}

.tool-description {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 0;
    line-height: 1.6;
}

/* Calculator Interface */
.calculator-interface {
    margin-bottom: 2rem;
}

.calculator-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e5e7eb;
}

/* Form Select Styling */
.form-select {
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    background: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-select option {
    padding: 0.5rem;
    font-size: 0.875rem;
}

.form-select optgroup {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.875rem;
    padding: 0.25rem 0;
}

.form-select optgroup option {
    font-weight: 400;
    color: var(--text-light);
    padding-left: 1rem;
}

/* Input Forms */
.input-forms {
    margin-bottom: 2rem;
}

.input-form {
    display: none;
}

.input-form.active {
    display: block;
}

.form-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.form-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.form-header p {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.formula-display {
    background: #f8fafc;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--text-color);
    border-left: 4px solid var(--primary-color);
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.form-input {
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

/* Action Controls */
.action-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.calculate-btn,
.clear-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-width: 160px;
    justify-content: center;
}

.calculate-btn {
    background: rgb(14, 134, 14);
    color: white;
}

.calculate-btn:hover {
    background: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.clear-btn {
    background: #f3f4f6;
    color: var(--text-color);
    border: 2px solid #e5e7eb;
}

.clear-btn:hover {
    background: #e5e7eb;
    transform: translateY(-2px);
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Messages */
.message-container {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.message-container.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.message-container.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.message-icon {
    font-size: 1.25rem;
}

/* Result Section */
.result-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.result-section.show {
    opacity: 1;
    transform: translateY(0);
}

.result-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid #e5e7eb;
    margin-bottom: 2rem;
}

.result-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.result-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.device-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.appliance-type {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-color);
}

.power-info {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Energy Results */
.energy-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.energy-result-container,
.cost-result-container {
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.energy-value,
.cost-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    line-height: 1;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease-in-out;
}

.energy-value.counting,
.cost-value.counting {
    color: var(--text-light);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.energy-unit,
.cost-unit {
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.energy-label,
.cost-label {
    font-size: 0.875rem;
    color: var(--text-color);
    font-weight: 600;
}

/* Period Breakdown */
.period-breakdown {
    margin-bottom: 2rem;
}

.period-breakdown h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
    text-align: center;
}

.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.breakdown-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: transform 0.2s ease;
}

.breakdown-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.breakdown-period {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.breakdown-energy {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.breakdown-cost {
    font-size: 1rem;
    font-weight: 600;
    color: #059669;
}

/* Calculation Details */
.calculation-details h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
    text-align: center;
}

.calculation-steps {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 4px solid var(--primary-color);
}

.calculation-step {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.calculation-step:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.step-description {
    font-size: 0.875rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.step-formula {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--primary-color);
    background: white;
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

/* SEO Content */
.seo-content {
    background: #f9fafb;
    padding: 3rem 0;
    margin-top: 2rem;
}

.content-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
}

.content-section {
    margin-bottom: 2rem;
}

.content-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.content-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

.content-section p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.content-section ul,
.content-section ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.content-section li {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.appliance-table {
    overflow-x: auto;
    margin: 1rem 0;
}

.appliance-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.appliance-table th,
.appliance-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.appliance-table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-color);
}

.appliance-table td {
    color: var(--text-light);
}

.appliance-table tr:last-child td {
    border-bottom: none;
}

/* Related Tools Section */
.related-tools-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 1000px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.related-tools-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.related-tools-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.related-tools-header h3 i {
    color: var(--primary-color);
}

.related-tools-header p {
    color: var(--text-light);
    margin: 0.5rem 0 0 0;
    font-size: 0.95rem;
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.related-tool-link {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid #e5e7eb;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.related-tool-link:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, #059669 100%);
    color: #ffffff;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.related-tool-link i {
    font-size: 0.875rem;
}

/* Responsive Design - Mobile First */
@media (max-width: 768px) {
    .tool-container {
        padding: 1rem;
    }

    .tool-header h1 {
        font-size: 1.75rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .calculator-card {
        padding: 1.5rem;
    }



    .input-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .action-controls {
        flex-direction: row;
        gap: 0.5rem;
    }

    .calculate-btn,
    .clear-btn {
        flex: 1;
        min-width: auto;
        justify-content: center;
        padding: 0.875rem 0.75rem;
        font-size: 0.875rem;
        min-height: 48px;
    }

    .energy-results {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .energy-value,
    .cost-value {
        font-size: 2rem;
    }

    .breakdown-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .content-container {
        padding: 0 1rem;
    }

    .appliance-table {
        font-size: 0.875rem;
    }

    .appliance-table th,
    .appliance-table td {
        padding: 0.5rem;
    }

    .related-tools-section {
        padding: 1.5rem;
        margin: 1.5rem 1rem;
    }

    .related-tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .related-tool-link {
        padding: 0.625rem 0.75rem;
        font-size: 0.8rem;
        flex-direction: column;
        gap: 4px;
    }

    .related-tool-link i {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .tool-container {
        padding: 0.75rem;
    }

    .tool-header h1 {
        font-size: 1.5rem;
    }

    .calculator-card {
        padding: 1rem;
    }



    .energy-value,
    .cost-value {
        font-size: 1.75rem;
    }

    .breakdown-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .breakdown-item {
        padding: 0.75rem;
    }

    .form-input {
        padding: 0.625rem;
        font-size: 0.875rem;
    }

    .calculate-btn,
    .clear-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .result-card {
        padding: 1.5rem;
    }

    .content-container {
        padding: 0 0.75rem;
    }

    .content-section h2 {
        font-size: 1.25rem;
    }

    .content-section h3 {
        font-size: 1.125rem;
    }

    .appliance-table {
        font-size: 0.8rem;
    }

    .appliance-table th,
    .appliance-table td {
        padding: 0.375rem;
    }

    .related-tools-section {
        padding: 1rem;
        margin: 1rem 0.75rem;
    }

    .related-tools-grid {
        grid-template-columns: 1fr;
    }

    .related-tool-link {
        flex-direction: row;
        gap: 8px;
        justify-content: flex-start;
        text-align: left;
    }
}



@media (max-width: 480px) {
    .action-controls {
        flex-direction: row;
        gap: 0.375rem;
    }

    .calculate-btn,
    .clear-btn {
        padding: 0.875rem 0.5rem;
        font-size: 0.85rem;
        flex: 1;
        min-width: auto;
        min-height: 44px;
    }

    .calculate-btn span,
    .clear-btn span {
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .calculate-btn i,
    .clear-btn i {
        font-size: 0.9rem;
    }
}
