/* Energy Algorithm Page Styles */

.algorithm-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    color: white;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin: 20px 0 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero-subtitle {
    font-size: 1.3rem;
    opacity: 0.95;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Loading */
.loading-container {
 text-align: center;
    padding: 60px 20px;
}

.loading-container p {
  margin-top: 20px;
    color: #666;
    font-size: 1.1rem;
}

/* Quick Navigation */
.nav-card {
    margin-bottom: 30px;
    background: linear-gradient(to right, #f8f9fa, #ffffff);
}

.nav-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: #333;
}

.quick-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: #f0f0f0;
    border-color: var(--accent-fill-rest);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    text-align: center;
    padding: 30px 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.metric-card:hover {
    transform: translateY(-5px);
 box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.metric-solar {
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    border-color: #FF9800;
}

.metric-battery {
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    border-color: #4CAF50;
}

.metric-blockchain {
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
    border-color: #2196F3;
}

.metric-balance {
    background: linear-gradient(135deg, #F1F8E9, #DCEDC8);
    border-color: #8BC34A;
}

.metric-card h3 {
  margin: 15px 0 10px;
    font-size: 1.4rem;
    color: #333;
}

.metric-card p {
    color: #666;
font-size: 0.95rem;
    line-height: 1.5;
}

/* Section Cards */
.section-card {
    margin-bottom: 30px;
    padding: 30px;
  border-radius: 12px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.section-card h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    color: #333;
    font-size: 1.8rem;
    padding-bottom: 15px;
    border-bottom: 3px solid #e0e0e0;
}

/* Flow Diagram */
.flow-diagram {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 30px 20px;
    background: linear-gradient(to bottom, #f8f9fa, #ffffff);
    border-radius: 12px;
    overflow-x: auto;
}

.flow-step {
    flex: 1;
    min-width: 150px;
    text-align: center;
}

.step-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.step-1 { background: linear-gradient(135deg, #c7efb4, #a8d88e); }
.step-2 { background: linear-gradient(135deg, #f093fb, #f5576c); }
.step-3 { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.step-4 { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.step-5 { background: linear-gradient(135deg, #fa709a, #fee140); }

.flow-step h4 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: #333;
}

.flow-step p {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}

.flow-arrow {
    font-size: 2rem;
    color: #bbb;
    flex-shrink: 0;
}

/* Priority List */
.priority-list {
  display: flex;
    flex-direction: column;
    gap: 20px;
}

.priority-item {
 display: flex;
    align-items: center;
    gap: 20px;
  padding: 25px;
  border-radius: 12px;
    background: white;
    border-left: 5px solid;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.priority-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.priority-1 { border-left-color: #FF9800; background: linear-gradient(to right, #FFF3E0, white); }
.priority-2 { border-left-color: #4CAF50; background: linear-gradient(to right, #E8F5E9, white); }
.priority-3 { border-left-color: #F44336; background: linear-gradient(to right, #FFEBEE, white); }

.priority-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
}

.priority-content {
    flex: 1;
}

.priority-content h4 {
    margin: 0 0 8px 0;
    font-size: 1.3rem;
    color: #333;
}

.priority-content p {
    margin: 0;
    color: #666;
    line-height: 1.5;
}

.priority-badge {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 15px;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Pricing Grid */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.pricing-card {
    text-align: center;
    padding: 25px 15px;
    background: linear-gradient(to bottom, #f8f9fa, white);
    border-radius: 12px;
 border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.pricing-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border-color: var(--accent-fill-rest);
}

.pricing-card h4 {
    margin: 15px 0 10px;
    font-size: 1.1rem;
    color: #333;
}

.price-amount {
    font-size: 2rem;
    font-weight: bold;
color: #667eea;
    margin: 10px 0;
}

.pricing-card p {
    color: #888;
    font-size: 0.9rem;
}

/* Blockchain Flow */
.blockchain-flow {
    display: flex;
 align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #667eea15, #764ba215);
    border-radius: 12px;
    overflow-x: auto;
}

.blockchain-step {
    flex: 1;
    min-width: 140px;
    text-align: center;
    padding: 20px 10px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.blockchain-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.blockchain-step h4 {
    font-size: 1rem;
    margin: 10px 0;
    color: #333;
}

.blockchain-step p {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}

.blockchain-arrow {
font-size: 2rem;
    color: #667eea;
    flex-shrink: 0;
}

/* Zero-Sum Card */
.zero-sum-card {
  background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
}

.zero-sum-visual {
    display: flex;
 align-items: center;
  justify-content: space-around;
    gap: 30px;
    margin: 30px 0;
 padding: 40px 20px;
    background: white;
    border-radius: 12px;
}

.balance-side {
    flex: 1;
    text-align: center;
    padding: 30px 20px;
    border-radius: 12px;
}

.balance-side.positive {
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    border: 3px solid #4CAF50;
}

.balance-side.negative {
 background: linear-gradient(135deg, #FFEBEE, #FFCDD2);
border: 3px solid #F44336;
}

.balance-side h3 {
    margin: 15px 0 10px;
    font-size: 1.4rem;
    color: #333;
}

.balance-side p {
    color: #666;
    margin-bottom: 20px;
}

.balance-amount {
    font-size: 2.5rem;
    font-weight: bold;
padding: 15px;
    border-radius: 8px;
    display: inline-block;
}

.positive-amount {
    background: #4CAF50;
    color: white;
}

.negative-amount {
    background: #F44336;
    color: white;
}

.balance-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.equals-sign {
    font-size: 4rem;
    font-weight: bold;
    color: #667eea;
}

.zero-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 30px;
    background: linear-gradient(135deg, #8BC34A, #689F38);
    color: white;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 4px 16px rgba(139, 195, 74, 0.4);
}

.zero-sum-formula {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
 background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 12px;
}

.zero-sum-formula code {
    font-size: 1.8rem;
    color: white;
    font-weight: bold;
    letter-spacing: 2px;
}

.zero-sum-note {
 display: flex;
    align-items: flex-start;
    gap: 12px;
 padding: 20px;
    background: rgba(102, 126, 234, 0.1);
    border-left: 4px solid #667eea;
    border-radius: 8px;
  color: #333;
    line-height: 1.6;
  margin-top: 20px;
}

/* Scenarios */
.scenario-content {
    padding: 20px;
}

.scenario-values {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.scenario-value {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
}

.scenario-content h4 {
 margin: 20px 0 10px;
    color: #333;
    font-size: 1.2rem;
}

.scenario-flow {
    list-style: none;
    padding: 0;
}

.scenario-flow li {
    padding: 12px 20px;
    margin: 8px 0;
  background: white;
    border-left: 4px solid #667eea;
    border-radius: 6px;
    font-size: 1.05rem;
}

.scenario-flow li.total-cost {
 background: linear-gradient(to right, #FFF3E0, white);
    border-left-color: #FF9800;
    font-size: 1.2rem;
    font-weight: bold;
}

/* Benefits */
.benefits-card {
    background: linear-gradient(135deg, #ffecd2, #fcb69f);
}

.benefits-grid {
    display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.benefit-item {
  text-align: center;
    padding: 30px 20px;
background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.benefit-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.benefit-item h4 {
    margin: 15px 0 10px;
    font-size: 1.3rem;
    color: #333;
}

.benefit-item p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Footer */
.algo-footer {
    margin-top: 40px;
padding: 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
 border-radius: 12px;
    text-align: center;
}

.algo-footer p {
    margin: 10px 0;
    line-height: 1.6;
}

.version-info {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 15px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .flow-diagram {
        flex-direction: column;
    }

  .flow-arrow {
      transform: rotate(90deg);
    }

    .zero-sum-visual {
        flex-direction: column;
    }

    .balance-center {
        flex-direction: row;
    }

    .equals-sign {
    transform: rotate(90deg);
    }

    .blockchain-flow {
        flex-direction: column;
    }

    .blockchain-arrow {
      transform: rotate(90deg);
    }
}

/* Animations */
@keyframes fadeIn {
    from {
   opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
     transform: translateY(0);
    }
}

.section-card,
.metric-card,
.nav-card {
    animation: fadeIn 0.6s ease-out;
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
 width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}
