/* Global Styles */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4361ee;
    --primary-light: #4895ef;
    --primary-gradient: linear-gradient(135deg, #4361ee 0%, #3f37c9 100%);
    --secondary-color: #3f37c9;
    --text-color: #2d3748;
    --text-light: #718096;
    --light-bg: #f8fafc;
    --white: #ffffff;
    --danger: #e53e3e;
    --success: #38b000;
    --border-radius: 10px;
    --box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
    --theme-transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease, fill 0.3s ease;
}

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

::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-thumb {
    background: var(--primary-color);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

::selection {
    background: var(--primary-light);
    color: var(--white);
}

.dark {
    --primary-color: #fbbf24;
    --primary-light: #facc15;
    --primary-gradient: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    --secondary-color: #f59e0b;
    --text-color: #edf2f7;
    --text-light: #e2e8f0;
    --light-bg: #1a202c;
    --white: #2d3748;
    --danger: #e53e3e;
    --success: #38b000;
    --border-radius: 10px;
}

.dark .btn-reset {
    background-color: #2d3748;
    color: #edf2f7;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark .btn-reset:hover:not(:disabled) {
    background-color: #4a5568;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 20px;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(67, 97, 238, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(67, 97, 238, 0.05) 0%, transparent 20%);
    background-attachment: fixed;
}

.container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 30px;
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* Apply theme transition to all needed elements */
body, .container, .file-item, .btn-reset, .notification, #toggler, 
.header h1, .header p, .file-icon, .file-name, .notification-message, 
.file-prompt i, .file-prompt p, .file-prompt span, #file-drop-area,
#selected-files-container h3, .notification-close, .move-file, .remove-file, 
#result, #result h3, footer, .notification-content {
    transition: var(--theme-transition);
}

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

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header h1 span {
    color: var(--primary-color);
    position: relative;
}

.header h1 span::after {
    content: '';
    position: absolute;
    bottom: 0px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

#toggler {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    font-size: 1.7rem;
    transition: var(--transition);
    padding: 10px;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.03);
    box-shadow: var(--card-shadow);
}

#toggler:hover {
    color: var(--primary-color);
    background-color: rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.dark #toggler {
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.dark #toggler:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* File Drop Area Styles */
.file-container {
    margin-bottom: 40px;
}

#file-drop-area {
    border: 2px dashed var(--primary-light);
    border-radius: var(--border-radius);
    padding: 40px;
    text-align: center;
    transition: var(--transition);
    margin-bottom: 25px;
    background-color: rgba(67, 97, 238, 0.03);
    position: relative;
    overflow: hidden;
}

#file-drop-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(67, 97, 238, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(67, 97, 238, 0.05) 0%, transparent 50%);
    z-index: 0;
}

#file-drop-area.highlight {
    border-color: var(--primary-color);
    background-color: rgba(67, 97, 238, 0.08);
    transform: scale(1.01);
}

.file-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.file-prompt i {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    opacity: 0.9;
    filter: drop-shadow(0 4px 6px rgba(67, 97, 238, 0.2));
}

.file-prompt p {
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 500;
}

.file-prompt span {
    margin: 12px 0;
    color: var(--text-light);
    position: relative;
    display: flex;
    align-items: center;
    width: 80%;
    max-width: 200px;
}

.file-prompt span::before,
.file-prompt span::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
    margin: 0 10px;
}

#file-input {
    display: none;
}

/* Selected Files Container */
#selected-files-container {
    margin-top: 35px;
}

#selected-files-container h3 {
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    font-weight: 600;
    color: var(--text-color);
    position: relative;
    padding-left: 15px;
}

#selected-files-container h3::before {
    content: '';
    position: absolute;
    left: 0;
    width: 4px;
    height: 18px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

#file-count {
    font-size: 0.9rem;
    margin-left: 8px;
    color: var(--text-light);
    font-weight: 400;
}

#selected-files-list {
    list-style: none;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background-color: var(--white);
    border-radius: var(--border-radius);
    margin-bottom: 12px;
    transition: var(--transition);
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.file-item:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.file-info {
    display: flex;
    align-items: center;
    overflow: hidden;
}

.file-icon {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-right: 12px;
    filter: drop-shadow(0 2px 3px rgba(67, 97, 238, 0.2));
}

.file-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
    font-weight: 500;
}

.file-actions {
    display: flex;
    align-items: center;
}

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

.move-file:hover {
    color: var(--primary-color);
    background-color: rgba(67, 97, 238, 0.08);
}

.move-file:disabled {
    color: #cbd5e0;
    cursor: not-allowed;
    background-color: transparent;
}

.remove-file {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--danger);
    font-size: 1rem;
    transition: var(--transition);
    margin-left: 10px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.remove-file:hover {
    background-color: rgba(229, 62, 62, 0.08);
    color: var(--danger);
}

/* Button Styles */
.btn-select, .btn-merge, .btn-reset, .btn-download {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    font-size: 1rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    gap: 8px;
}

.btn-select {
    background: var(--primary-gradient);
    color: var(--white);
    padding: 12px 28px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.2);
}

.btn-select:hover {
    box-shadow: 0 6px 15px rgba(67, 97, 238, 0.3);
    transform: translateY(-2px);
}

.controls {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.btn-merge {
    background: var(--primary-gradient);
    color: var(--white);
    padding: 14px 32px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.2);
}

.btn-merge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.5s ease;
}

.btn-merge:hover:not(:disabled)::before {
    left: 100%;
}

.btn-merge:hover:not(:disabled) {
    box-shadow: 0 6px 15px rgba(67, 97, 238, 0.3);
    transform: translateY(-2px);
}

.btn-reset {
    background-color: #edf2f7;
    color: var(--text-color);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.btn-reset:hover:not(:disabled) {
    background-color: #e2e8f0;
}

.btn-merge:disabled, .btn-reset:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-merge i, .btn-download i {
    margin-right: 6px;
}

/* Result Section */
#result {
    margin-top: 35px;
    padding: 25px;
    background-color: rgba(56, 176, 0, 0.1);
    border-radius: var(--border-radius);
    text-align: center;
    animation: fadeIn 0.6s ease;
    border: 1px solid rgba(56, 176, 0, 0.2);
    position: relative;
}

#result::before {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(56, 176, 0, 0.1);
    top: -20px;
    right: -20px;
    z-index: 0;
}

#result h3 {
    margin-bottom: 15px;
    color: var(--success);
    font-weight: 600;
    position: relative;
    font-size: 1.3rem;
    z-index: 1;
}

.result-actions {
    margin-top: 20px;
    position: relative;
    z-index: 1;
}

.btn-download {
    background: linear-gradient(135deg, var(--success) 0%, #2d9300 100%);
    color: var(--white);
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(56, 176, 0, 0.2);
    padding: 14px 30px;
    border-radius: var(--border-radius);
}

.btn-download:hover {
    background: linear-gradient(135deg, #38b000 0%, #2a8a00 100%);
    box-shadow: 0 6px 15px rgba(56, 176, 0, 0.3);
    transform: translateY(-2px);
}

/* Custom Notification Styles */
#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
    width: 100%;
}

.notification {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    background-color: var(--white);
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    animation: slideIn 0.3s ease forwards;
    overflow: hidden;
    position: relative;
    border-left: 5px solid transparent;
}

.notification.success {
    border-left-color: var(--success);
}

.notification.error {
    border-left-color: var(--danger);
}

.notification-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
}

.notification-icon {
    font-size: 1.2rem;
    margin-top: 2px;
}

.notification.success .notification-icon {
    color: var(--success);
}

.notification.error .notification-icon {
    color: var(--danger);
}

.notification-message {
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 500;
    margin-right: 15px;
    line-height: 1.4;
}

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

.notification-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
}

.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--primary-gradient);
    width: 100%;
    transform-origin: left;
    animation: progress 5s linear forwards;
}

.notification.success .notification-progress {
    background: linear-gradient(135deg, var(--success) 0%, #2d9300 100%);
}

.notification.error .notification-progress {
    background: linear-gradient(135deg, var(--danger) 0%, #c81e1e 100%);
}

/* Utilities */
.hidden {
    display: none;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px 0;
    color: var(--text-light);
    font-size: 0.95rem;
}

footer i {
    color: var(--danger);
    margin: 0 3px;
    animation: pulse 2s infinite;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(50px);
    }
}

@keyframes progress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Media Queries */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .file-prompt i {
        font-size: 2.8rem;
    }
    
    .file-name {
        max-width: 180px;
    }
    
    #file-drop-area {
        padding: 30px 20px;
    }
    
    #toggler {
        top: 8px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 15px 10px;
    }
    
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    #file-drop-area {
        padding: 25px 15px;
    }
    
    .file-name {
        max-width: 120px;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .btn-merge, .btn-reset {
        width: 100%;
    }
    
    .file-prompt span {
        width: 100%;
    }
    
    #toggler {
        top: 20px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
        padding: 8px;
    }
    
    .header {
        padding-top: 15px;
    }
}