/* Color Variables */
:root {
    --flipper-orange: #FF9300;
    --flipper-orange-hover: #e68200;
    --flipper-orange-active: #cc7600;
    --light-background: #f8f9fa;
    --dark-background: #1a1a1a;
    --light-text: #333;
    --dark-text: #f8f9fa;
    --light-container-bg: #ffffff;
    --dark-container-bg: #2c2c2c;
    --light-border: #e0e0e0;
    --dark-border: #444;
    --input-light-bg: #ffffff;
    --input-dark-bg: #3a3a3a;
    --input-light-border: #ced4da;
    --input-dark-border: #555;
    --input-focus-shadow: rgba(255, 147, 0, 0.25);
    --button-summary-bg-light: #f0f0f0;
    --button-summary-bg-dark: #444;
    --summary-container-bg-light: #f9f9f9;
    --summary-container-bg-dark: #1e1e1e;
    --summary-item-bg-light: #ffffff;
    --summary-item-bg-dark: #2a2a2a;
    --summary-item-box-shadow-light: rgba(0,0,0,0.05);
    --summary-item-box-shadow-dark: rgba(0,0,0,0.3);
    --detailed-summary-th-bg-light: #f2f2f2;
    --detailed-summary-th-bg-dark: #444;
    --detailed-summary-border-light: #ddd;
    --detailed-summary-border-dark: #555;
    --progress-container-bg-light: #ddd;
    --progress-container-bg-dark: #555;
    --notification-success-bg-light: #d4edda;
    --notification-success-text-light: #155724;
    --notification-success-bg-dark: #155724;
    --notification-success-text-dark: #d4edda;
    --notification-error-bg-light: #f8d7da;
    --notification-error-text-light: #721c24;
    --notification-error-bg-dark: #721c24;
    --notification-error-text-dark: #f8d7da;
    --notification-info-bg-light: #d1ecf1;
    --notification-info-text-light: #0c5460;
    --notification-info-bg-dark: #0c5460;
    --notification-info-text-dark: #d1ecf1;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Light Mode */
body.light-mode {
    background: linear-gradient(135deg, var(--light-background), #e6e6e6);
    color: var(--light-text);
}

/* Dark Mode */
body.dark-mode {
    background: linear-gradient(135deg, var(--dark-background), #000000);
    color: var(--dark-text);
}

/* Container */
.container {
    max-width: 600px;
    width: 90%;
    background-color: var(--light-container-bg);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--light-border);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

body.dark-mode .container {
    background-color: var(--dark-container-bg);
    border-color: var(--dark-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Decorative Gradient */
.container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,147,0,0.1) 0%, rgba(255,147,0,0) 70%);
    transform: rotate(45deg);
    z-index: -1;
    transition: transform 0.5s ease;
}

.container:hover::before {
    transform: rotate(60deg);
}

/* Headings */
h1 {
    text-align: center;
    color: var(--flipper-orange);
    font-size: 32px;
    margin-bottom: 30px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    position: relative;
    padding-bottom: 15px;
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--flipper-orange);
    border-radius: 2px;
}

h2 {
    margin-top: 0;
    color: var(--flipper-orange);
}

h3 {
    margin-top: 20px;
    color: var(--flipper-orange);
}

h4 {
    margin-top: 15px;
    color: var(--flipper-orange);
}

/* Instructions */
.instructions {
    background-color: #e9ecef;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode .instructions {
    background-color: #111;
    color: var(--dark-text);
}

.instructions ol {
    padding-left: 20px;
}

.instructions ul {
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 10px;
}

/* Form Elements */
input, select, textarea {
    width: 100%;
    padding: 15px 20px;
    margin-bottom: 20px;
    border: 2px solid var(--input-light-border);
    border-radius: 30px;
    background-color: var(--input-light-bg);
    color: var(--light-text);
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

body.dark-mode input, 
body.dark-mode select, 
body.dark-mode textarea {
    background-color: var(--input-dark-bg);
    color: var(--dark-text);
    border-color: var(--input-dark-border);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--flipper-orange);
    outline: none;
    box-shadow: 0 0 0 4px var(--input-focus-shadow);
    transform: translateY(-2px);
}

/* Buttons */
button {
    display: block;
    width: 100%;
    padding: 16px;
    background-color: var(--flipper-orange);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.6s;
}

button:hover::before {
    left: 100%;
}

button:hover {
    background-color: var(--flipper-orange-hover);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(255, 147, 0, 0.3);
}

button:active {
    background-color: var(--flipper-orange-active);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(255, 147, 0, 0.3);
}

/* Radio Buttons */
.radio-group {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.radio-group input[type="radio"] {
    margin-right: 5px;
}

.radio-group label {
    cursor: pointer;
    font-weight: 500;
}

/* File Input */
.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
    margin-bottom: 10px;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-wrapper .custom-file-label {
    display: block;
    padding: 15px 20px;
    background-color: var(--flipper-orange);
    color: white;
    border-radius: 30px;
    text-align: center;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.file-input-wrapper .custom-file-label:hover {
    background-color: var(--flipper-orange-hover);
}

/* File Count */
#file-count {
    font-size: 14px;
    color: #555;
    margin-top: -10px;
    margin-bottom: 20px;
    transition: color 0.3s ease;
}

body.dark-mode #file-count {
    color: var(--dark-text);
}

/* Browser Warning */
#browser-warning {
    color: red;
    font-size: 14px;
    margin-bottom: 20px;
}

/* Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.checkbox-container input[type="checkbox"] {
    margin-right: 10px;
    width: auto;
}

.checkbox-container label {
    font-size: 16px;
    cursor: pointer;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    background-color: var(--progress-container-bg-light);
    border-radius: 4px;
    margin: 20px 0;
    display: none;
    transition: background-color 0.3s ease;
}

body.dark-mode .progress-container {
    background-color: var(--progress-container-bg-dark);
}

.progress-bar {
    width: 0%;
    height: 20px;
    background-color: var(--flipper-orange);
    border-radius: 4px;
    text-align: center;
    color: white;
    line-height: 20px;
    font-size: 12px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

/* Summary Section */
.summary-container {
    border: 1px solid #ccc;
    padding: 20px;
    border-radius: 8px;
    background-color: var(--summary-container-bg-light);
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, opacity 0.5s ease;
    opacity: 0;
    display: none;
}

body.dark-mode .summary-container {
    background-color: var(--summary-container-bg-dark);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

.summary-container.show {
    display: block;
    opacity: 1;
}

.summary-details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.summary-item {
    flex: 1 1 200px;
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-radius: 5px;
    background-color: var(--summary-item-bg-light);
    box-shadow: 0 2px 4px var(--summary-item-box-shadow-light);
    transition: background-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

body.dark-mode .summary-item {
    background-color: var(--summary-item-bg-dark);
    box-shadow: 0 2px 4px var(--summary-item-box-shadow-dark);
    color: var(--dark-text);
}

.summary-label {
    font-weight: bold;
}

.summary-value.success { color: green; }
.summary-value.warning { color: orange; }
.summary-value.error { color: red; }

.button-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.button-summary div {
    background-color: var(--button-summary-bg-light);
    padding: 5px 10px;
    border-radius: 5px;
    text-align: center;
    font-size: 14px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode .button-summary div {
    background-color: var(--button-summary-bg-dark);
    color: var(--dark-text);
}

.detailed-summary {
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.detailed-summary table {
    width: 100%;
    border-collapse: collapse;
}

.detailed-summary th, .detailed-summary td {
    border: 1px solid var(--detailed-summary-border-light);
    padding: 8px;
    text-align: center;
    transition: border-color 0.3s ease, color 0.3s ease;
}

body.dark-mode .detailed-summary th, 
body.dark-mode .detailed-summary td {
    border-color: var(--detailed-summary-border-dark);
    color: var(--dark-text);
}

.detailed-summary th {
    background-color: var(--detailed-summary-th-bg-light);
}

body.dark-mode .detailed-summary th {
    background-color: var(--detailed-summary-th-bg-dark);
}

/* Summary Actions */
.summary-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.summary-actions button {
    flex: 1;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 250px;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
    font-size: 14px;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.notification.show {
    display: block;
    animation: fadeInOut 5s forwards;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-20px); }
    10% { opacity: 1; transform: translateY(0); }
    90% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}

.notification.success {
    background-color: var(--notification-success-bg-light);
    color: var(--notification-success-text-light);
}

body.dark-mode .notification.success {
    background-color: var(--notification-success-bg-dark);
    color: var(--notification-success-text-dark);
}

.notification.error {
    background-color: var(--notification-error-bg-light);
    color: var(--notification-error-text-light);
}

body.dark-mode .notification.error {
    background-color: var(--notification-error-bg-dark);
    color: var(--notification-error-text-dark);
}

.notification.info {
    background-color: var(--notification-info-bg-light);
    color: var(--notification-info-text-light);
}

body.dark-mode .notification.info {
    background-color: var(--notification-info-bg-dark);
    color: var(--notification-info-text-dark);
}

/* Theme Toggle Button */
.theme-toggle button {
    background-color: var(--flipper-orange);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 10px 15px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 20px;
}

.theme-toggle button:hover {
    background-color: var(--flipper-orange-hover);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        width: 100%;
        max-width: none;
        padding: 20px;
        border-radius: 15px;
        box-sizing: border-box;
    }

    h1 {
        font-size: 28px;
        margin-bottom: 25px;
    }

    input, select, textarea, button, .file-input-wrapper .custom-file-label {
        width: 100%;
        font-size: 16px;
        padding: 12px 16px;
        margin-bottom: 15px;
        box-sizing: border-box;
    }

    .file-input-wrapper {
        margin-bottom: 15px;
    }

    .theme-toggle {
        position: fixed;
        top: 20px;
        right: 20px;
    }

    .theme-toggle button {
        padding: 10px 16px;
        font-size: 14px;
    }

    .instructions {
        font-size: 16px;
        padding: 0 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    input, select, textarea, button, .file-input-wrapper .custom-file-label {
        font-size: 14px;
        padding: 10px 14px;
    }

    .theme-toggle button {
        padding: 8px 12px;
        font-size: 12px;
    }

    .instructions {
        font-size: 14px;
    }
}
