/* ============================================
   Variable Definitions
   ============================================ */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --success-color: #10b981;
    --error-color: #ef4444;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.2);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================
   Header Styles
   ============================================ */
.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    animation: fadeInDown 0.6s ease;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.title-icon {
    font-size: 2.5rem;
    animation: bounce 2s infinite;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* ============================================
   Bookmark Banner
   ============================================ */
.bookmark-banner {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    padding: 15px 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
    animation: slideDown 0.5s ease;
}

.bookmark-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.bookmark-icon {
    font-size: 1.5rem;
}

.bookmark-text {
    flex: 1;
    text-align: center;
    color: var(--text-color);
}

.bookmark-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.bookmark-link:hover {
    text-decoration: underline;
}

.bookmark-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 0 5px;
    transition: var(--transition);
}

.bookmark-close:hover {
    color: var(--text-color);
}

/* ============================================
   Card Styles
   ============================================ */
.calculator-card,
.results-card,
.schedule-card,
.chart-card,
.comparison-card,
.tips-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.6s ease;
}

.calculator-header,
.results-header,
.schedule-header,
.chart-header,
.comparison-header,
.tips-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calculator-header h2,
.results-header h2,
.schedule-header h2,
.chart-header h2,
.comparison-header h2,
.tips-header h2 {
    font-size: 1.5rem;
    color: var(--text-color);
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.close-btn:hover {
    background: var(--bg-color);
    color: var(--text-color);
}

/* ============================================
   Form Styles
   ============================================ */
.calculator-form {
    display: grid;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.label-icon {
    font-size: 1.2rem;
}

.form-group input,
.form-group select {
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.term-input-group {
    display: flex;
    gap: 10px;
}

.term-input-group input {
    flex: 1;
}

.term-input-group select {
    width: 120px;
}

.form-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--card-bg);
    color: var(--text-color);
    transition: var(--transition);
    cursor: pointer;
}

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

.input-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}

.summary-note {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 5px;
}

.calculate-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    margin-top: 10px;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.calculate-btn:active {
    transform: translateY(0);
}

/* ============================================
   Results Styles
   ============================================ */
.results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.summary-item {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.summary-label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 8px;
    font-weight: 500;
}

.summary-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.results-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.action-btn {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-color);
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ============================================
   Schedule Table Styles
   ============================================ */
.schedule-table-container {
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.schedule-table thead {
    position: sticky;
    top: 0;
    background: var(--primary-color);
    color: white;
    z-index: 10;
}

.schedule-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.schedule-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}

.schedule-table tbody tr:hover {
    background: var(--bg-color);
}

.schedule-table tbody tr:nth-child(even) {
    background: rgba(102, 126, 234, 0.05);
}

/* ============================================
   Chart Styles
   ============================================ */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

/* ============================================
   Comparison Styles
   ============================================ */
.comparison-content {
    display: grid;
    gap: 20px;
}

.comparison-item {
    background: var(--bg-color);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.comparison-item h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.comparison-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.comparison-stat {
    text-align: center;
}

.comparison-stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 5px;
}

.comparison-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
}

/* ============================================
   Tips Styles
   ============================================ */
.tips-content {
    display: grid;
    gap: 20px;
}

.tip-item {
    background: var(--bg-color);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--success-color);
}

.tip-item h3 {
    margin-bottom: 10px;
    color: var(--success-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.tip-item p {
    color: var(--text-light);
    line-height: 1.8;
}

.tip-savings {
    margin-top: 10px;
    padding: 10px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 6px;
    font-weight: 600;
    color: var(--success-color);
}

/* ============================================
   Footer Styles
   ============================================ */
.footer {
    text-align: center;
    color: white;
    padding: 30px 0;
    opacity: 0.9;
}

.footer p {
    margin: 5px 0;
}

/* ============================================
   Utility Classes
   ============================================ */
.hidden {
    display: none !important;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ============================================
   Calendar Reminder Section
   ============================================ */
.calendar-reminder-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
    text-align: center;
}

.calendar-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.calendar-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.calendar-btn:active {
    transform: translateY(0);
}

.calendar-icon {
    font-size: 1.5rem;
}

.calendar-text {
    font-family: inherit;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .title-icon {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .calculator-card,
    .results-card,
    .schedule-card,
    .chart-card,
    .comparison-card,
    .tips-card {
        padding: 20px;
    }
    
    .results-summary {
        grid-template-columns: 1fr;
    }
    
    .results-actions {
        grid-template-columns: 1fr;
    }
    
    .summary-value {
        font-size: 1.5rem;
    }
    
    .term-input-group {
        flex-direction: column;
    }
    
    .term-input-group select {
        width: 100%;
    }
    
    .schedule-table {
        font-size: 0.8rem;
    }
    
    .schedule-table th,
    .schedule-table td {
        padding: 8px;
    }
    
    .chart-container {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .calculator-card,
    .results-card,
    .schedule-card,
    .chart-card,
    .comparison-card,
    .tips-card {
        padding: 15px;
    }
    
    .schedule-table-container {
        max-height: 400px;
    }
}

/* ============================================
   Footer Styles
   ============================================ */
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: white;
    opacity: 0.9;
}

.footer-links {
    margin-top: 15px;
    font-size: 0.9rem;
}

.footer-link {
    color: white;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.footer-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ============================================
   Recent Queries
   ============================================ */
.recent-queries-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recent-query-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.recent-query-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    transform: translateX(3px);
}

.recent-query-content {
    flex: 1;
}

.recent-query-date {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 3px;
}

.recent-query-time {
    font-size: 0.8rem;
    color: var(--text-light);
}

.recent-query-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.recent-query-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.recent-query-btn:hover {
    transform: rotate(90deg) scale(1.1);
    box-shadow: var(--shadow-sm);
}

.recent-query-delete-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--error-color);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 300;
    transition: var(--transition);
    flex-shrink: 0;
    line-height: 1;
}

.recent-query-delete-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
    box-shadow: var(--shadow-sm);
}

