/* APR App - Modern Design Theme - Aligned with Portfolio */

/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Base Styles */
:root {
    /* Primary Colors - Rich Blue Palette */
    --primary-dark: #1a365d;  /* Deep navy blue */
    --primary: #2a4a7f;       /* Rich medium blue */
    --primary-light: #4c6da3; /* Softer blue */
    
    /* Accent Colors */
    --accent: #f0b429;        /* Warm gold accent */
    --accent-light: #f7d794;  /* Light gold */
    
    /* Neutral Colors */
    --neutral-dark: #2d3748;  /* Dark slate for text */
    --neutral-medium: #718096; /* Medium gray for secondary text */
    --neutral-light: #e2e8f0; /* Light gray for backgrounds */
    
    /* UI Colors */
    --text-dark: #1a202c;     /* Almost black for primary text */
    --text-light: #ffffff;    /* White for text on dark backgrounds */
    --background: #f7fafc;    /* Very light gray for main background */
    --gray-light: #edf2f7;    /* Light gray for cards/sections */
    --gray: #cbd5e0;          /* Medium gray for borders */
    
    /* Success/Error Colors */
    --success: #48bb78;       /* Green for success messages */
    --error: #e53e3e;         /* Red for error states */
    
    /* Transitions */
    --transition: all 0.3s ease;
}

/* Dark Mode Theme */
[data-theme="dark"] {
    --primary-dark: #6b8bbd;  /* Lighter in dark mode */
    --primary: #a1abbb;       /* Lighter in dark mode */
    --primary-light: #abb9d3; /* Lighter in dark mode */
    
    --accent: #876413;        /* Keep accent color */
    --accent-light: #f7d794;  /* Keep accent light */
    
    --neutral-dark: #e2e8f0;  /* Lighter in dark mode */
    --neutral-medium: #a0aec0; /* Lighter in dark mode */
    --neutral-light: #2d3748; /* Darker in dark mode */
    
    --text-dark: #e2e8f0;     /* Light text in dark mode */
    --text-light: #1a202c;    /* Dark text on light backgrounds in dark mode */
    --background: #121212;    /* Dark background */
    --gray-light: #2a2a2a;    /* Darker gray for cards/sections */
    --gray: #4a4a4a;          /* Darker gray for borders */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--background);
    padding-top: 2rem;
    padding-bottom: 5rem;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--primary-dark);
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}



/* Layout and Containers */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.form-container, .result-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    background-color: var(--text-light);
    transition: var(--transition);
}

.form-container:hover, .result-container:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
    position: relative;
    display: inline-block;
}

.header h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--accent);
}

.header .lead {
    font-size: 1.2rem;
    color: var(--neutral-medium);
    margin-top: 1.5rem;
}

/* Form Elements */
.form-label {
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    border: 1px solid var(--neutral-light);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: var(--transition);
    color: var(--text-dark);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.25rem rgba(76, 109, 163, 0.25);
    outline: none;
}

/* Special Period Options */
.special-period-options {
    padding: 1.5rem;
    margin-top: 1.5rem;
    border: 1px solid var(--accent-light);
    border-radius: 8px;
    background-color: var(--gray-light);
    transition: all 0.3s ease;
}

/* Buttons */
.btn {
    padding: 0.8rem 2rem;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
    z-index: -1;
}

.btn:hover:before {
    left: 100%;
}

.btn-primary {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--neutral-dark);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--text-light);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(42, 74, 127, 0.3);
}

.btn-success {
    background-color: var(--success);
    border-color: var(--success);
    color: var(--text-light);
}

.btn-success:hover, .btn-success:focus {
    background-color: #3da066; /* Darker shade of success */
    border-color: #3da066;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(72, 187, 120, 0.3);
}

/* Summary Boxes */
.summary-box {
    background-color: var(--gray-light);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-left: 4px solid var(--primary);
    transition: all 0.3s ease;
}

.summary-box:hover {
    box-shadow: 0 0.3rem 0.8rem rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

.summary-box h5 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-weight: 700;
}

/* Table Styles */
.table-responsive {
    margin-top: 2.5rem;
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    width: 100%;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scrollbar-width: thin; /* For Firefox */
    scrollbar-color: var(--primary-light) var(--gray-light); /* For Firefox */
}

/* Custom scrollbar for Webkit browsers */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: var(--gray-light);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background-color: var(--primary-light);
    border-radius: 4px;
}

/* Add scroll indicator */
.table-scroll-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    background-color: var(--accent);
    color: var(--text-dark);
    padding: 4px 8px;
    font-size: 0.8rem;
    border-radius: 4px 0 8px 0;
    opacity: 0.8;
    z-index: 1;
}

.table {
    margin-bottom: 0;
    color: var(--text-dark);
}

.table-dark {
    background-color: var(--primary-dark);
    color: var(--text-light);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(76, 109, 163, 0.05);
}

.table-hover tbody tr:hover {
    background-color: rgba(76, 109, 163, 0.1);
    transition: var(--transition);
}

/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background-color: var(--text-light);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 1rem 5%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--primary-dark);
    position: relative;
    padding-left: 10px;
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
    color: var(--primary-dark);
}

.navbar-brand::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background-color: var(--accent);
    border-radius: 2px;
    transition: height 0.3s ease;
}

.navbar-brand:hover::before {
    height: 28px;
}

.navbar-nav {
    display: flex;
    list-style: none;
}

.navbar-nav .nav-item {
    margin-left: 1.5rem;
}

.navbar-nav .nav-link {
    color: var(--text-dark);
    font-weight: 500;
    position: relative;
    font-size: 1.05rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s ease, background-color 0.3s ease;
}

.navbar-nav .nav-link:hover, .navbar-nav .nav-link.active {
    color: var(--accent);
    transform: translateY(-2px);
}

.navbar-nav .nav-link:hover::after, .navbar-nav .nav-link.active::after {
    width: 100%;
}

.navbar-toggler {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
    z-index: 1000;
    transition: all 0.3s ease;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    body {
        padding-top: 5rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .form-container, .result-container {
        padding: 1.5rem;
    }
    
    .summary-box {
        margin-bottom: 1.5rem;
    }
    
    .navbar-toggler {
        display: block;
    }
    
    .navbar-collapse {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background-color: var(--text-light);
        padding: 2rem;
        transition: right 0.3s ease;
        z-index: 999;
    }
    
    .navbar-collapse.show {
        right: 0;
    }
    
    .navbar-nav {
        flex-direction: column;
    }
    
    .navbar-nav .nav-item {
        margin: 1rem 0;
    }
}

/* Form Check (Radio buttons and checkboxes) */
.form-check-input {
    width: 1.2em;
    height: 1.2em;
    margin-top: 0.25em;
    border: 1px solid var(--primary-light);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-label {
    padding-left: 0.5rem;
}

/* Back Button Section */
.back-button {
    margin-top: 2rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes slideInLeft {
    from { transform: translateX(-50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out forwards;
}

@keyframes slideInRight {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out forwards;
}

/* Card Hover Effects */
.card {
    transition: all 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
    border: none;
    box-shadow: 0 0.3rem 0.8rem rgba(0, 0, 0, 0.1);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15);
}

/* Workflow container styles */
.workflow-container {
    margin: 1rem 0;
    background-color: var(--gray-light);
    border-radius: 8px;
    padding: 1.5rem;
    transition: var(--transition);
}

.workflow-content h3 {
    color: var(--primary-dark);
    font-size: 1.3rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

.workflow-content h3:first-child {
    margin-top: 0;
}

.workflow-content ul {
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.workflow-content ol {
    counter-reset: item;
    list-style-type: none;
    padding-left: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

.workflow-content ol li {
    counter-increment: item;
    margin-bottom: 0.75rem;
    padding-left: 2rem;
    position: relative;
}

.workflow-content ol li:before {
    content: counter(item);
    background-color: var(--accent);
    color: var(--neutral-dark);
    font-weight: 600;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 0;
    top: 0;
    font-size: 0.9rem;
}

.workflow-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.workflow-content p {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}