:root {
    /* Light Mode Colors */
    --bg-primary: linear-gradient(135deg, #4CAF50 0%, #45a049 50%, #388E3C 100%);
    --bg-container: #ffffff;
    --bg-intro: #F1F8E9;
    --bg-input: #F1F8E9;
    --bg-input-focus: #ffffff;
    --bg-modal: #ffffff;
    --bg-modal-overlay: rgba(0, 0, 0, 0.7);
    --bg-tab: #ffffff;
    --bg-tab-hover: #F1F8E9;
    --bg-tab-active: #2E7D32;
    --bg-button: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    --bg-button-hover: linear-gradient(135deg, #45a049 0%, #4CAF50 100%);
    --bg-result-data: #ffffff;
    --bg-logo: #ffffff;
    --bg-modal-close-hover: #F5F5F5;
    --bg-copy-button: #2196F3;
    --bg-copy-button-hover: #1976D2;
    --bg-copy-button-copied: #4CAF50;
    --bg-theme-toggle: rgba(255, 255, 255, 0.2);
    --bg-theme-toggle-hover: rgba(255, 255, 255, 0.3);

    --text-primary: #ffffff;
    --text-secondary: #2E7D32;
    --text-tertiary: #1B5E20;
    --text-label: #2E7D32;
    --text-modal-title: #2E7D32;
    --text-modal-close: #666;
    --text-modal-close-hover: #333;
    --text-data-label: #2E7D32;
    --text-data-value: #1B5E20;
    --text-error: #C62828;
    --text-tab: #2E7D32;
    --text-tab-active: #ffffff;
    --text-placeholder: rgba(27, 94, 32, 0.5);

    --border-primary: #4CAF50;
    --border-secondary: #2E7D32;
    --border-error: #F44336;
    --border-success: #4CAF50;
    --border-divider: #E0E0E0;
    --border-modal: #E0E0E0;

    --shadow-logo: 0 10px 30px rgba(0,0,0,0.2);
    --shadow-logo-hover: 0 15px 40px rgba(0,0,0,0.3);
    --shadow-container: 0 20px 60px rgba(0, 0, 0, 0.3);
    --shadow-button: 0 10px 30px rgba(76, 175, 80, 0.4);
    --shadow-button-hover: 0 15px 40px rgba(76, 175, 80, 0.5);
    --shadow-input-focus: 0 5px 15px rgba(76, 175, 80, 0.3);
    --shadow-step-number: 0 2px 8px rgba(76, 175, 80, 0.3);
    --shadow-modal: 0 20px 60px rgba(0, 0, 0, 0.5);

    --input-error-bg: #FFEBEE;
    --input-valid-bg: #E8F5E9;
    --result-success-bg: #E8F5E9;
    --result-error-bg: #FFEBEE;
}

[data-theme="dark"] {
    /* Dark Mode Colors */
    --bg-primary: linear-gradient(135deg, #1B5E20 0%, #2E7D32 50%, #388E3C 100%);
    --bg-container: #1e1e1e;
    --bg-intro: #2d2d2d;
    --bg-input: #2d2d2d;
    --bg-input-focus: #3a3a3a;
    --bg-modal: #1e1e1e;
    --bg-modal-overlay: rgba(0, 0, 0, 0.85);
    --bg-tab: #2d2d2d;
    --bg-tab-hover: #3a3a3a;
    --bg-tab-active: #2E7D32;
    --bg-button: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    --bg-button-hover: linear-gradient(135deg, #45a049 0%, #4CAF50 100%);
    --bg-result-data: #2d2d2d;
    --bg-logo: #2d2d2d;
    --bg-modal-close-hover: #3a3a3a;
    --bg-copy-button: #2196F3;
    --bg-copy-button-hover: #1976D2;
    --bg-copy-button-copied: #4CAF50;
    --bg-theme-toggle: rgba(255, 255, 255, 0.15);
    --bg-theme-toggle-hover: rgba(255, 255, 255, 0.25);

    --text-primary: #ffffff;
    --text-secondary: #81C784;
    --text-tertiary: #A5D6A7;
    --text-label: #81C784;
    --text-modal-title: #81C784;
    --text-modal-close: #b0b0b0;
    --text-modal-close-hover: #ffffff;
    --text-data-label: #81C784;
    --text-data-value: #A5D6A7;
    --text-error: #EF5350;
    --text-tab: #81C784;
    --text-tab-active: #ffffff;
    --text-placeholder: rgba(129, 199, 132, 0.7);

    --border-primary: #4CAF50;
    --border-secondary: #66BB6A;
    --border-error: #EF5350;
    --border-success: #4CAF50;
    --border-divider: #3a3a3a;
    --border-modal: #3a3a3a;

    --shadow-logo: 0 10px 30px rgba(0,0,0,0.5);
    --shadow-logo-hover: 0 15px 40px rgba(0,0,0,0.7);
    --shadow-container: 0 20px 60px rgba(0, 0, 0, 0.6);
    --shadow-button: 0 10px 30px rgba(76, 175, 80, 0.4);
    --shadow-button-hover: 0 15px 40px rgba(76, 175, 80, 0.5);
    --shadow-input-focus: 0 5px 15px rgba(76, 175, 80, 0.4);
    --shadow-step-number: 0 2px 8px rgba(76, 175, 80, 0.4);
    --shadow-modal: 0 20px 60px rgba(0, 0, 0, 0.8);

    --input-error-bg: #3d2727;
    --input-valid-bg: #2d3d2d;
    --result-success-bg: #2d3d2d;
    --result-error-bg: #3d2727;
}

[data-theme="dark"] select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2381C784' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.main-wrapper {
    max-width: 800px;
    width: 100%;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--bg-theme-toggle);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.theme-toggle:hover {
    background: var(--bg-theme-toggle-hover);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.theme-toggle svg {
    width: 28px;
    height: 28px;
    fill: var(--text-primary);
    transition: transform 0.3s ease;
}

.theme-toggle:hover svg {
    transform: rotate(20deg);
}

@media (max-width: 768px) {
    .theme-toggle {
        width: 50px;
        height: 50px;
        top: -10px;
        right: -10px;
    }

    .theme-toggle svg {
        width: 24px;
        height: 24px;
    }
}

.logo-link {
    display: block;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.logo-link:hover {
    transform: scale(1.05);
}

.logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    background: var(--bg-logo);
    border-radius: 50%;
    padding: 20px;
    box-shadow: var(--shadow-logo);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.3s ease, background 0.3s ease;
}

.logo-link:hover .logo {
    box-shadow: var(--shadow-logo-hover);
}

.logo-svg .logo-text {
    fill: var(--border-primary);
    transition: fill 0.3s ease;
}

.logo-svg .logo-checkmark {
    stroke: var(--border-primary);
    transition: stroke 0.3s ease;
}

h1 {
    color: var(--text-primary);
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 15px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
    line-height: 1.2;
    transition: color 0.3s ease;
}

.subtitle {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.container {
    background: var(--bg-container);
    border-radius: 30px;
    box-shadow: var(--shadow-container);
    padding: 30px 35px;
    margin-bottom: 30px;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.page-title {
    color: var(--text-secondary);
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 25px;
    text-align: center;
    font-family: 'Bungee Inline', sans-serif;
    transition: color 0.3s ease;
}

@media (max-width: 768px) {
    .container {
        border-radius: 20px;
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    .page-title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
}

.intro-section {
    background: var(--bg-intro);
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 30px;
    border: 2px solid var(--border-primary);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.intro-section p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-align: center;
    line-height: 1.6;
    transition: color 0.3s ease;
}

@media (max-width: 768px) {
    .intro-section {
        padding: 15px;
        margin-bottom: 20px;
        border-radius: 15px;
    }
    
    .intro-section p {
        font-size: 0.95rem;
        line-height: 1.5;
    }
}

.tabs-container {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 3px solid var(--border-divider);
    transition: border-color 0.3s ease;
}

.tab {
    flex: 1;
    padding: 15px;
    background: var(--bg-tab);
    border: none;
    border-radius: 15px 15px 0 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-tab);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab.active {
    background: var(--bg-tab-active);
    color: var(--text-tab-active);
    transform: translateY(-3px);
}

.tab:hover:not(.active) {
    background: var(--bg-tab-hover);
}

.tab-content {
    display: none;
}

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

.form-group {
    position: relative;
    margin-bottom: 28px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.form-group::before {
    content: '';
    position: absolute;
    left: 22px;
    top: 50px;
    height: calc(100% + 10px);
    width: 2px;
    background: var(--border-divider);
    z-index: 0;
    transition: background 0.3s ease;
}

.form-group:last-child::before {
    display: none;
}

.step-number {
    min-width: 45px;
    width: 45px;
    height: 45px;
    background: var(--border-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.3rem;
    box-shadow: var(--shadow-step-number);
    position: relative;
    z-index: 1;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
}

.form-field-wrapper {
    flex: 1;
    min-width: 0;
}

label {
    display: block;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-label);
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

input[type="text"],
input[type="date"],
select {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-primary);
    border-radius: 12px;
    font-size: 1.1rem;
    background: var(--bg-input);
    transition: all 0.3s ease;
    color: var(--text-tertiary);
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232E7D32' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
    padding-right: 40px;
    cursor: pointer;
}

input[type="text"]::placeholder,
input[type="date"]::placeholder {
    color: var(--text-placeholder);
    opacity: 1;
}

input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: var(--bg-input);
    border: 2px solid var(--border-primary);
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
}

input[type="checkbox"]:checked {
    background: var(--border-primary);
    border-color: var(--border-primary);
}

input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
}

input[type="checkbox"]:focus {
    outline: 2px solid var(--border-primary);
    outline-offset: 2px;
}

input[type="text"]:focus,
input[type="date"]:focus,
select:focus {
    outline: none;
    border-color: var(--border-success);
    background: var(--bg-input-focus);
    box-shadow: var(--shadow-input-focus);
}

input[type="text"].error,
input[type="date"].error,
select.error {
    border-color: var(--border-error);
    background: var(--input-error-bg);
}

input[type="text"].valid,
input[type="date"].valid,
select.valid {
    border-color: var(--border-success);
    background: var(--input-valid-bg);
}

.big-button {
    width: 100%;
    background: var(--bg-button);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 18px;
    font-size: 1.4rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-button);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.big-button:hover {
    background: var(--bg-button-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-button-hover);
}

.big-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.error-message {
    color: var(--text-error);
    font-size: 0.95rem;
    margin-top: 6px;
    font-weight: 600;
}

.result-container {
    margin-top: 30px;
    padding: 20px;
    border-radius: 15px;
    background: var(--bg-result-data);
    border: 2px solid var(--border-primary);
    display: none;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.result-container.show {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

.result-title {
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 15px;
    color: var(--text-secondary);
    text-align: center;
}

.result-data {
    background: var(--bg-result-data);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid var(--border-primary);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.data-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-divider);
    transition: border-color 0.3s ease;
}

.data-item:last-child {
    border-bottom: none;
}

.data-label {
    font-weight: 700;
    color: var(--text-data-label);
    text-transform: capitalize;
    transition: color 0.3s ease;
}

.data-value {
    color: var(--text-data-value);
    font-weight: 600;
    text-align: right;
    word-break: break-word;
    transition: color 0.3s ease;
}

.footer {
    text-align: center;
    color: var(--text-primary);
    font-size: 1.1rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    transition: color 0.3s ease;
}

.footer a {
    color: var(--text-primary);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-modal-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-modal);
    border-radius: 20px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-modal);
    transform: scale(0.9);
    transition: transform 0.3s ease, background 0.3s ease;
}

@media (max-width: 768px) {
    .modal {
        width: 95%;
        max-width: 95%;
        max-height: 85vh;
        border-radius: 15px;
    }
    
    .modal-header {
        padding: 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .modal-title {
        font-size: 1.3rem;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-close {
        width: 35px;
        height: 35px;
        font-size: 1.8rem;
    }
    
    .export-button {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid var(--border-modal);
    transition: border-color 0.3s ease;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-title {
    font-size: 1.5rem;
    color: var(--text-modal-title);
    font-weight: 900;
    transition: color 0.3s ease;
}

.export-button {
    background: var(--bg-copy-button);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: none; /* Hidden by default, shown via JavaScript for successful results */
    align-items: center;
    gap: 6px;
}

.export-button:hover {
    background: var(--bg-copy-button-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

.export-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-modal-close);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

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

.modal-body {
    padding: 20px;
}

.modal-error {
    text-align: center;
    padding: 20px 0;
}

.modal-message {
    font-size: 1.2rem;
    color: var(--text-error);
    font-weight: 600;
}

.copy-button {
    background: var(--bg-copy-button);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.copy-button:hover {
    background: var(--bg-copy-button-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

.copy-button.copied {
    background: var(--bg-copy-button-copied);
    animation: copyPulse 0.5s ease;
}

@keyframes copyPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.2rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .container {
        padding: 25px 20px;
    }
    
    .tabs-container {
        flex-direction: column;
        gap: 5px;
    }

    .tab {
        border-radius: 15px;
        border-bottom: 3px solid transparent;
    }

    .tab.active {
        border-bottom-color: var(--border-secondary);
    }
    
    .form-group {
        gap: 10px;
        margin-bottom: 24px;
        flex-wrap: nowrap;
    }
    
    .form-group::before {
        left: 17px;
        top: 40px;
    }
    
    .step-number {
        min-width: 38px;
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
        flex-shrink: 0;
    }
    
    .form-field-wrapper {
        min-width: 0;
        flex: 1;
    }
    
    label {
        font-size: 1rem;
        margin-bottom: 8px;
        line-height: 1.4;
    }
    
    input[type="text"],
    input[type="date"] {
        padding: 14px 12px;
        font-size: 1rem;
    }
    
    select {
        padding: 15px 40px 15px 15px;
        font-size: 1rem;
        background-position: right 15px center;
        min-height: 50px;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
    
    .big-button {
        font-size: 1.3rem;
        padding: 18px;
        letter-spacing: 0.5px;
    }
    
    .data-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .data-label {
        font-size: 0.95rem;
    }
    
    .data-value {
        text-align: left;
        font-size: 0.95rem;
        width: 100%;
    }
    
    .copy-button {
        margin-left: 0;
        margin-top: 8px;
        width: 100%;
        text-align: center;
    }
}
