/* ===================================
   SHARED STYLES FOR ALL PAGES
   This file is linked in every HTML page
   =================================== */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===================================
   HEADER SECTION
   =================================== */
.site-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.site-header h1 {
    font-size: 32px;
    margin: 0;
    font-weight: 600;
}

.site-tagline {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 5px;
}

/* ===================================
   NAVIGATION BAR
   =================================== */
.main-nav {
    background-color: #34495e;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-content a {
    color: white;
    text-decoration: none;
    padding: 15px 25px;
    display: block;
    transition: background-color 0.3s ease;
    font-weight: 500;
}

.nav-content a:hover {
    background-color: #2c3e50;
}

.nav-content a.active {
    background-color: #3498db;
    font-weight: 600;
}

/* Dropdown Menu Styles */
.dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.dropdown-toggle {
    color: white;
    text-decoration: none;
    padding: 15px 25px;
    display: block;
    transition: background-color 0.3s ease;
    font-weight: 500;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 16px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.dropdown-toggle:after {
    content: " ▼";
    font-size: 12px;
    margin-left: 5px;
}

.dropdown-toggle:hover {
    background-color: #2c3e50;
}

.dropdown-content {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    background-color: #2c3e50;
    min-width: 220px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    border-radius: 0 0 5px 5px;
}

.dropdown-content a {
    color: white;
    padding: 12px 20px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s ease;
    font-weight: 500;
}

.dropdown-content a:hover {
    background-color: #3498db;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown:hover .dropdown-toggle {
    background-color: #2c3e50;
}

/* ===================================
   MAIN CONTENT AREA
   =================================== */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    width: 100%;
}

.calculator-container {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* ===================================
   CALCULATOR-SPECIFIC STYLES
   These styles work for all calculators
   =================================== */
.calculator-title {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
}

.input-section {
    background: #ecf0f1;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.input-item {
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

label {
    font-weight: bold;
    color: #34495e;
    margin-bottom: 5px;
    font-size: 14px;
}

input, select {
    padding: 10px;
    border: 2px solid #bdc3c7;
    border-radius: 5px;
    font-size: 16px;
}

input:focus, select:focus {
    outline: none;
    border-color: #3498db;
}

.result-box {
    background: #e8f5e8;
    border: 2px solid #27ae60;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.result-box h2 {
    color: #27ae60;
    margin: 0 0 10px 0;
}

.result-value {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

.table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    position: relative;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

th, td {
    padding: 12px;
    text-align: right;
    border: 1px solid #ddd;
}

th {
    background-color: #3498db;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

tr:hover {
    background-color: #e3f2fd;
}

.period-col {
    text-align: center !important;
}

.currency {
    color: #27ae60;
    font-weight: bold;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.stat-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #3498db;
}

.stat-label {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}

.export-section {
    text-align: center;
    margin: 20px 0;
}

.export-btn {
    background: #2c3e50;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.export-btn:hover {
    background: #34495e;
}

.export-btn:active {
    transform: translateY(1px);
}

/* ===================================
   HOME PAGE STYLES
   =================================== */
.home-intro {
    text-align: center;
    margin-bottom: 40px;
}

.home-intro h2 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.home-intro p {
    color: #7f8c8d;
    font-size: 18px;
    line-height: 1.6;
}

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.calculator-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.calculator-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.calculator-card h3 {
    color: #3498db;
    margin-bottom: 10px;
    font-size: 22px;
}

.calculator-card p {
    color: #7f8c8d;
    line-height: 1.6;
}

.calculator-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

/* ===================================
   FOOTER
   =================================== */
.site-footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: auto;
}

.site-footer p {
    margin: 5px 0;
    font-size: 14px;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */
@media (max-width: 768px) {
    .site-header h1 {
        font-size: 24px;
    }
    
    .nav-content a {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .calculator-container {
        padding: 20px;
    }
    
    .input-item {
        min-width: 100%;
    }
}
