* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-light);
}

.hero-image {
    width: 100%;
    height: 400px;
    overflow: hidden;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sticky-header {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-icon {
    font-size: 2rem;
    line-height: 1;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: white;
    border-bottom: none;
    padding-bottom: 0;
    flex: 1;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.user-info {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

.logout-button {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.4rem 0.875rem;
    border-radius: 0.375rem;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    line-height: 1;
}

.logout-button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

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

.intro {
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: var(--text-color);
    line-height: 1.8;
}

.section {
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

h1 {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--primary-color);
}

h2 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin: 2rem 0 1rem;
    display: flex;
    align-items: center;
}

h2::before {
    content: '';
    width: 4px;
    height: 1.5rem;
    background: var(--primary-color);
    margin-right: 0.75rem;
    border-radius: 2px;
}

h3 {
    font-size: 1.25rem;
    color: var(--text-color);
    margin: 1.5rem 0 1rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-color);
}

ul {
    margin: 1rem 0;
    padding-left: 2rem;
}

li {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.cost-item {
    background: var(--bg-light);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--primary-color);
}

.initial-cost-breakdown {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
}

.initial-cost-breakdown h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.initial-cost-breakdown ul {
    margin: 0;
    padding-left: 1.5rem;
}

.initial-cost-breakdown ul li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.highlight {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin: 1.5rem 0;
}

.highlight strong {
    font-size: 1.25rem;
}

code {
    background: var(--bg-light);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
    font-weight: 600;
}

.payment-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.payment-card {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 1rem;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.payment-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.payment-card h3 {
    color: var(--primary-color);
    margin-top: 0;
    font-size: 1.5rem;
}

.payment-info {
    margin: 1rem 0;
}

.payment-info strong {
    display: block;
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.payment-info p {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    font-family: 'Courier New', monospace;
}

.qr-code {
    text-align: center;
    margin-top: 1.5rem;
}

.qr-code img {
    max-width: 200px;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

.link-box {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 2px solid var(--primary-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.link-box a {
    color: var(--primary-color);
    text-decoration: none;
    word-break: break-all;
    font-weight: 500;
}

.link-box a:hover {
    text-decoration: underline;
}

.password-box {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    border-left: 4px solid var(--success-color);
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .hero-image {
        height: 250px;
    }

    .header-title {
        font-size: 1.2rem;
    }

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

    .container {
        margin-top: 1.5rem;
        padding: 0 1rem;
    }

    .section {
        padding: 1.5rem;
    }

    .payment-section {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }
}

.badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* File Explorer Styles */
.file-explorer {
    margin-top: 1.5rem;
}

.file-tree {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.file-tree ul {
    list-style: none;
    padding-left: 2rem;
    margin: 0.5rem 0;
}

.folder-item,
.file-item {
    margin: 0.5rem 0;
}

.folder-item details {
    cursor: pointer;
}

.folder-item summary {
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 0.5rem;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    list-style: none;
    display: flex;
    align-items: center;
    font-weight: 500;
    color: var(--text-color);
}

.folder-item summary::-webkit-details-marker {
    display: none;
}

.folder-item summary::before {
    content: '▶';
    display: inline-block;
    margin-right: 0.5rem;
    transition: transform 0.2s ease;
    font-size: 0.75rem;
}

.folder-item details[open] > summary::before {
    transform: rotate(90deg);
}

.folder-item summary:hover {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.folder-icon {
    margin-right: 0.5rem;
    font-size: 1.25rem;
}

.file-item a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-light);
    border-radius: 0.5rem;
    border: 2px solid transparent;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s ease;
}

.file-item a:hover {
    background: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
    transform: translateX(4px);
}

.file-icon {
    margin-right: 0.75rem;
    font-size: 1.25rem;
}

.file-name {
    flex: 1;
    font-weight: 500;
    word-break: break-word;
}

.file-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-left: 1rem;
}

.file-size,
.file-date {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .file-tree ul {
        padding-left: 1rem;
    }

    .file-meta {
        flex-direction: column;
        gap: 0.25rem;
        font-size: 0.75rem;
    }

    .folder-item summary,
    .file-item a {
        padding: 0.5rem 0.75rem;
    }
}

/* Payment Calculator Styles */
.payment-calculator {
    margin: 2rem 0;
    background: var(--bg-white);
    border-radius: 1rem;
    overflow: hidden;
}

:root {
    --frank-color: #f97316;
    --frank-light: #fed7aa;
    --felix-color: #2563eb;
    --felix-light: #dbeafe;
}

.year-tabs {
    display: flex;
    gap: 0;
    background: var(--bg-light);
    border-bottom: 2px solid var(--border-color);
}

.year-tab {
    flex: 1;
    padding: 1rem 2rem;
    background: transparent;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.year-tab:hover {
    background: rgba(37, 99, 235, 0.05);
    color: var(--primary-color);
}

.year-tab.active {
    color: var(--primary-color);
    background: var(--bg-white);
    border-bottom-color: var(--primary-color);
}

.year-content {
    display: none;
    padding: 2rem;
}

.year-content.active {
    display: block;
}

.year-content h3 {
    margin-top: 0;
    margin-bottom: 2rem;
    color: var(--text-color);
    font-size: 1.5rem;
}

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

.calculation-grid-simple {
    max-width: 400px;
    margin: 0 auto;
}

.person-calc,
.person-calc-simple {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 2px solid var(--border-color);
}

.person-calc h4,
.person-calc-simple h4 {
    margin: 0 0 1.5rem 0;
    font-size: 1.25rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.payment-to-frank,
.payment-to-felix {
    display: block;
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 2px solid;
    width: 100%;
    box-sizing: border-box;
}

.payment-section-header {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.payment-to-frank {
    background: #fff7ed;
    border-color: var(--frank-color);
}

.payment-to-frank .payment-section-header {
    color: var(--frank-color);
}

.payment-to-felix {
    background: #eff6ff;
    border-color: var(--felix-color);
}

.payment-to-felix .payment-section-header {
    color: var(--felix-color);
}

.calc-row {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 0.5rem 0;
    gap: 0.75rem;
    font-size: 0.9rem;
    align-items: start;
}

.calc-row span {
    color: var(--text-color);
    line-height: 1.4;
    min-width: 0;
    overflow-wrap: break-word;
}

.calc-row strong {
    color: var(--text-color);
    font-family: 'Courier New', monospace;
    white-space: nowrap;
    text-align: right;
}

.payment-section-total {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    margin-top: 0.75rem;
    border-top: 2px solid;
    font-weight: 700;
}

.payment-to-frank .payment-section-total {
    border-top-color: var(--frank-color);
    color: var(--frank-color);
}

.payment-to-felix .payment-section-total {
    border-top-color: var(--felix-color);
    color: var(--felix-color);
}

.payment-section-total strong {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
}

.calc-note {
    color: var(--text-light);
    font-style: italic;
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

.total-payment {
    text-align: center;
    padding: 0.75rem;
    margin-top: 1rem;
    background: var(--bg-light);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 600;
}

.note {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    padding: 1rem 1.5rem;
    margin-top: 2rem;
    border-radius: 0.5rem;
    color: #92400e;
    font-weight: 500;
}

@media (max-width: 768px) {
    .year-tab {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .year-content {
        padding: 1rem;
    }

    .year-content h3 {
        font-size: 1.25rem;
    }

    .calculation-grid {
        grid-template-columns: 1fr;
    }

    .person-calc,
    .person-calc-simple {
        padding: 1rem;
    }

    .person-calc h4,
    .person-calc-simple h4 {
        font-size: 1.1rem;
    }

    .payment-section {
        padding: 0.75rem;
    }

    .payment-section-header {
        font-size: 0.9rem;
    }

    .calc-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
        font-size: 0.85rem;
    }

    .calc-row strong {
        text-align: left;
    }

    .payment-section-total {
        font-size: 0.95rem;
    }

    .total-payment {
        font-size: 0.8rem;
    }

    .header-actions {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-end;
    }

    .user-info {
        font-size: 0.8rem;
    }

    .logout-button {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}
