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

* {
    transition: all 0.3s ease;
}

body {
    font-family: 'Poppins', sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0;
}

.container {
    background-color: #fff;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 650px;
    margin: 2rem auto;
    backdrop-filter: blur(10px);
    animation: slideIn 0.6s ease-out;
    box-sizing: border-box;
}

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

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

header h1 {
    font-weight: 700;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 0.5rem 0;
    animation: fadeIn 0.8s ease-out;
}

header p {
    color: #666;
    font-size: 1.1rem;
    font-weight: 300;
    margin: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

h3 {
    font-weight: 600;
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

.file-upload-area {
    border: 2px dashed #667eea;
    border-radius: 15px;
    padding: 2.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    background-color: #f8f9ff;
    position: relative;
    overflow: hidden;
}

.file-upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.file-upload-area:hover {
    border-color: #764ba2;
    background-color: #f0f0ff;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.file-upload-area:hover::before {
    left: 100%;
}

.file-upload-area.dragover {
    border-color: #764ba2;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.2);
    transform: scale(1.02);
}

.file-upload-area p {
    margin: 0;
    color: #666;
    font-weight: 500;
}

#file-list, #insert-file-list {
    margin-top: 1rem;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f5f7ff 0%, #e8ebf8 100%);
    border-radius: 10px;
    margin-bottom: 0.75rem;
    border-left: 4px solid #667eea;
    animation: slideInLeft 0.4s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.file-item span {
    font-weight: 500;
    color: #333;
    flex: 1;
}

.file-item button {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.file-item button:hover {
    background-color: rgba(220, 53, 69, 0.1);
    transform: scale(1.1);
}

.options {
    margin-top: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f8f9ff;
    border-radius: 10px;
}

.input-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
}

.input-group input[type="radio"] {
    margin-right: 0.5rem;
    cursor: pointer;
    accent-color: #667eea;
    width: 18px;
    height: 18px;
}

.input-group label[for] {
    display: inline-block;
    margin-right: 1.5rem;
    font-weight: 500;
    cursor: pointer;
}

button#merge-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 1rem 2rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 1.5rem auto 0;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

button#merge-button:hover:not(.hidden) {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

button#merge-button:active:not(.hidden) {
    transform: translateY(-1px);
}

button#merge-button.hidden {
    display: none !important;
}

a#download-link {
    background: linear-gradient(135deg, #28a745 0%, #1a6d2e 100%);
    color: #fff;
    padding: 1rem 2rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 1.5rem auto 0;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.3);
    animation: slideDown 0.4s ease-out;
}

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

a#download-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(40, 167, 69, 0.4);
}

a#download-link:active {
    transform: translateY(-1px);
}

footer {
    text-align: center;
    padding: 2rem 1.5rem;
    background-color: #1a1a2e;
    color: #fff;
    font-weight: 500;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-content p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.footer-content strong {
    color: #667eea;
    font-weight: 700;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(102, 126, 234, 0.2);
    color: #667eea;
    transition: all 0.3s ease;
    text-decoration: none;
}

.footer-links a:hover {
    background-color: #667eea;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.footer-links svg {
    width: 24px;
    height: 24px;
}

/* Help Button & Modal */
.help-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
}

.help-button:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
}

.help-button:active {
    transform: scale(1.05);
}

.help-button svg {
    width: 28px;
    height: 28px;
}

.help-icon {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
}

.help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.help-modal.hidden {
    display: none !important;
}

.help-modal-content {
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.4s ease-out;
}

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

.help-modal-header {
    padding: 2rem;
    border-bottom: 2px solid #f0f0ff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.help-modal-header h2 {
    margin: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.5rem;
}

.close-button {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-button:hover {
    background-color: #f0f0ff;
    color: #333;
}

.help-modal-body {
    padding: 2rem;
}

.help-step {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0ff;
}

.help-step:last-of-type {
    border-bottom: none;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.help-step h3 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.1rem;
}

.help-step p {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

.help-step strong {
    color: #667eea;
    font-weight: 600;
}

.help-info {
    background-color: #f8f9ff;
    border-left: 4px solid #667eea;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    color: #666;
    font-size: 0.95rem;
}

/* Responsive Design - Tablets & Small Devices */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
        margin: 1rem auto;
        border-radius: 15px;
    }

    header h1 {
        font-size: 2rem;
    }

    header p {
        font-size: 0.95rem;
    }

    h3 {
        font-size: 1.1rem;
        margin-top: 1.2rem;
    }

    .file-upload-area {
        padding: 1.5rem;
        margin-bottom: 1.2rem;
        border-radius: 12px;
    }

    .file-upload-area p {
        font-size: 0.9rem;
    }

    .file-item {
        padding: 0.6rem 0.8rem;
        border-radius: 8px;
        margin-bottom: 0.6rem;
    }

    .input-group {
        padding: 0.8rem;
        border-radius: 8px;
        margin-bottom: 1.2rem;
    }

    .input-group label {
        font-size: 0.95rem;
    }

    .input-group label[for] {
        font-size: 0.9rem;
        margin-right: 1rem;
    }

    button#merge-button,
    a#download-link {
        max-width: 100%;
        padding: 0.9rem 1.5rem;
        font-size: 1rem;
        margin: 1rem auto 0;
    }

    .help-button {
        width: 48px;
        height: 48px;
        bottom: 1.5rem;
        right: 1.5rem;
    }

    .help-modal-content {
        max-width: 90vw;
        border-radius: 15px;
    }

    .help-modal-header {
        padding: 1.5rem;
    }

    .help-modal-header h2 {
        font-size: 1.3rem;
    }

    .help-modal-body {
        padding: 1.5rem;
    }

    .help-step {
        gap: 1rem;
        margin-bottom: 1.2rem;
        padding-bottom: 1.2rem;
    }

    .step-number {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .help-step h3 {
        font-size: 1rem;
    }

    .help-step p {
        font-size: 0.9rem;
    }

    footer {
        padding: 1.5rem 1rem;
    }

    .footer-links {
        gap: 1rem;
        margin-top: 0.8rem;
    }

    .footer-links a {
        width: 36px;
        height: 36px;
    }

    .footer-links svg {
        width: 20px;
        height: 20px;
    }

    .footer-content p {
        font-size: 0.9rem;
        margin: 0.4rem 0;
    }
}

/* Responsive Design - Mobile Phones */
@media (max-width: 480px) {
    * {
        transition: all 0.2s ease;
    }

    body {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        padding: 0;
        margin: 0;
    }

    .container {
        padding: 1rem;
        margin: 0.75rem auto;
        max-width: calc(100% - 1rem);
        width: 100%;
        border-radius: 12px;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
        box-sizing: border-box;
    }

    header {
        margin-bottom: 1.2rem;
    }

    header h1 {
        font-size: 1.5rem;
        margin: 0 0 0.2rem 0;
    }

    header p {
        font-size: 0.8rem;
        margin: 0;
    }

    h3 {
        font-size: 0.95rem;
        margin-bottom: 0.7rem;
        margin-top: 0.9rem;
    }

    main {
        display: flex;
        flex-direction: column;
    }

    .file-upload-area {
        padding: 1rem;
        margin-bottom: 0.9rem;
        border-radius: 10px;
    }

    .file-upload-area p {
        font-size: 0.75rem;
        margin: 0;
    }

    .file-upload-area:hover {
        transform: none;
    }

    .file-upload-area.dragover {
        transform: scale(1.01);
    }

    #file-list,
    #insert-file-list {
        margin-top: 0.6rem;
    }

    .file-item {
        padding: 0.5rem;
        margin-bottom: 0.4rem;
        border-left-width: 3px;
    }

    .file-item span {
        font-size: 0.8rem;
    }

    .file-item button {
        font-size: 1.2rem;
        padding: 0;
    }

    .input-group {
        padding: 0.6rem;
        margin-bottom: 0.9rem;
        border-radius: 8px;
    }

    .input-group label {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
        display: block;
    }

    .input-group input[type="radio"] {
        width: 14px;
        height: 14px;
        margin-right: 0.3rem;
    }

    .input-group label[for] {
        font-size: 0.8rem;
        margin-right: 0.6rem;
        display: inline-block;
    }

    button#merge-button,
    a#download-link {
        max-width: 100%;
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        margin: 0.7rem auto 0;
        box-sizing: border-box;
    }

    .help-button {
        width: 44px;
        height: 44px;
        bottom: 1rem;
        right: 1rem;
    }

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

    .help-modal {
        padding: 0;
    }

    .help-modal-content {
        max-width: 95%;
        max-height: 85vh;
        border-radius: 12px;
        margin: auto;
    }

    .help-modal-header {
        padding: 1rem 0.9rem;
    }

    .help-modal-header h2 {
        font-size: 1.1rem;
    }

    .close-button {
        font-size: 1.5rem;
        width: 32px;
        height: 32px;
    }

    .help-modal-body {
        padding: 1rem 0.9rem;
    }

    .help-step {
        gap: 0.7rem;
        margin-bottom: 0.9rem;
        padding-bottom: 0.9rem;
    }

    .step-number {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
        flex-shrink: 0;
    }

    .help-step h3 {
        font-size: 0.9rem;
        margin: 0 0 0.3rem 0;
    }

    .help-step p {
        font-size: 0.8rem;
        line-height: 1.3;
    }

    .help-info {
        padding: 0.7rem;
        margin-top: 0.8rem;
        font-size: 0.8rem;
    }

    footer {
        padding: 1rem 0.8rem;
    }

    .footer-content {
        max-width: 100%;
    }

    .footer-content p {
        font-size: 0.75rem;
        margin: 0.2rem 0;
    }

    .footer-links {
        gap: 0.7rem;
        margin-top: 0.5rem;
    }

    .footer-links a {
        width: 30px;
        height: 30px;
    }

    .footer-links a:hover {
        transform: translateY(-2px);
    }

    .footer-links svg {
        width: 16px;
        height: 16px;
    }
}
