/* --- БАЗОВЫЕ СТИЛИ --- */
:root {
    --neon-primary: #02AED6;
    --neon-secondary: #000E40;
    --neon-text: #fff;
    --neon-gray: #888;
    --bg-dark: #0a0a0a;
    --bg-darker: #050505;
}
:root[data-theme="light"] {
    --neon-primary: #0088ff;
    --neon-secondary: #00a2ff;
    --neon-text: #2c3e50;
    --bg-dark: #f8f9fa;
    --bg-darker: #ffffff;
}
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--bg-dark);
    color: var(--neon-text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, color 0.3s ease;
    box-sizing: border-box;
    overflow-x: hidden;
}
table {
    border-collapse: collapse;
    width: 100%;
}
th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- СПЕЦИФИЧНЫЕ СТИЛИ --- */

/* Excel */
.excel-sheet {
    margin: 32px auto;
    padding: 0;
    background: #fafdff;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,136,255,0.10), 0 2px 8px rgba(0,136,255,0.08);
    overflow: visible;
    max-width: 1000px;
    border: 2.5px solid var(--neon-primary);
    animation: fadeInSlide 0.7s cubic-bezier(.4,0,.2,1);
    transition: box-shadow 0.3s, border-color 0.3s;
}
.excel-sheet:hover {
    box-shadow: 0 12px 40px rgba(0,136,255,0.18), 0 4px 16px rgba(0,136,255,0.12);
    border-color: var(--neon-secondary);
}
.excel-sheet .excel-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,136,255,0.10);
    font-size: 16px;
    transition: font-size 0.2s, box-shadow 0.3s;
    margin: 0;
    animation: fadeInTable 0.8s cubic-bezier(.4,0,.2,1);
}
@keyframes fadeInTable {
    from { opacity: 0; transform: translateY(30px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}
.excel-sheet .excel-table th, .excel-sheet .excel-table td {
    border: 2px solid #90caf9;
    border-right: 1.5px solid #42a5f5;
    border-bottom: 2px solid #64b5f6;
    padding: 10px 14px;
    text-align: left;
    word-break: break-word;
    max-width: 220px;
    background-clip: padding-box;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    background: #fff;
}
.excel-sheet .excel-table th {
    background: linear-gradient(90deg, #e3f0ff 0%, #c6e6ff 100%);
    font-weight: 700;
    color: #0074d9;
    border-top: 2.5px solid #1976d2;
    border-bottom: 2.5px solid #42a5f5;
    letter-spacing: 1px;
    font-size: 17px;
    text-shadow: 0 1px 8px #b3e5fc;
}
.excel-sheet .excel-table tr:nth-child(even) td {
    background: #f4faff;
}
.excel-sheet .excel-table tr {
    transition: box-shadow 0.2s, background 0.2s;
    animation: fadeInRow 0.5s cubic-bezier(.4,0,.2,1);
}
@keyframes fadeInRow {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}
.excel-sheet .excel-table tr:hover td {
    border-color: #1976d2;
    box-shadow: 0 0 16px 2px #00bfff55, 0 0 0 2px #90caf9;
    background: #e3f2fd;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 6px #00e6ff88);
}
.excel-sheet .excel-table td:focus {
    outline: 2px solid #00e6ff;
    box-shadow: 0 0 0 2px #00e6ff;
    background: #e0f7fa;
}

/* PDF */
.pdf-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}
.pdf-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.pdf-text {
    margin-top: 20px;
    line-height: 1.6;
    color: #333;
    font-size: 16px;
    text-align: left;
    word-wrap: break-word;
}

/* Word (только стиль в стиле PDF) */
.word-content {
    width: 1000px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}
.word-content img {
    max-width: 1000px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.word-text {
    margin-top: 20px;
    line-height: 1.6;
    color: #333;
    font-size: 16px;
    text-align: left;
    word-wrap: break-word;
}

.theme-switch {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.theme-switch input[type="checkbox"] {
    display: none;
}

.theme-switch label {
    cursor: pointer;
    padding: 10px;
    background: var(--bg-darker);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.theme-switch label:hover {
    box-shadow: 0 0 15px var(--neon-primary);
}

.theme-switch label svg {
    width: 24px;
    height: 24px;
    fill: var(--neon-text);
    transition: fill 0.3s ease;
}

.theme-switch input[type="checkbox"]:checked + label svg {
    fill: var(--neon-primary);
}

.container {
    background-color: var(--bg-darker);
    padding: 20px 30px 30px 30px;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 136, 255, 0.1),
                0 0 40px rgba(0, 162, 255, 0.05);
    border: 1px solid rgba(0, 136, 255, 0.1);
    backdrop-filter: blur(10px);
    width: fit-content;
    min-width: 600px;
    max-width: 1000px;
    margin: 0 auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    color: var(--neon-text);
    text-align: center;
    font-size: 2.5em;
    margin: 0 0 30px 0;
    text-shadow: 0 0 3px var(--neon-primary),
                 0 0 6px var(--neon-primary),
                 0 0 9px var(--neon-primary);
    letter-spacing: 3px;
    animation: pulse 2s infinite;
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    width: fit-content;
    white-space: nowrap;
}

:root[data-theme="light"] h1 {
    text-shadow: none;
    animation: none;
}

.upload-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    width: 100%;
    margin-top: 0;
}

.file-input {
    padding: 25px;
    border: 2px dashed rgba(0, 136, 255, 0.3);
    border-radius: 10px;
    width: 100%;
    text-align: center;
    transition: all 0.3s ease;
    background: rgba(0, 136, 255, 0.05);
    margin: 0;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.file-input:hover {
    border-color: var(--neon-primary);
    box-shadow: 0 0 15px rgba(0, 136, 255, 0.2);
    background: rgba(0, 136, 255, 0.08);
}

.custom-file-upload {
    background: linear-gradient(45deg, var(--neon-primary), var(--neon-secondary));
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    margin: 0 auto;
    display: block;
    box-shadow: 0 2px 5px rgba(0, 136, 255, 0.2);
}

.custom-file-upload:hover {
    background: linear-gradient(45deg, var(--neon-secondary), var(--neon-primary));
    box-shadow: 0 4px 15px rgba(0, 136, 255, 0.3);
    transform: translateY(-1px);
}

.custom-file-upload.highlight {
    background: var(--neon-secondary);
    border-color: var(--neon-primary);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--neon-primary-rgb), 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(var(--neon-primary-rgb), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--neon-primary-rgb), 0);
    }
}

.file-input input[type="file"] {
    display: none;
}

.file-input .filename {
    margin-top: 10px;
    color: var(--neon-text);
    font-size: 16px;
    font-weight: normal;
    text-transform: none;
    letter-spacing: normal;
    word-break: break-all;
    text-align: center;
    display: none;
}

.file-input .no-file {
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    text-align: center;
    width: 100%;
}

.buttons-container {
    display: flex;
    gap: 15px;
    width: 100%;
    justify-content: center;
}

.submit-btn {
    background: linear-gradient(45deg, var(--neon-primary), var(--neon-secondary));
    color: var(--neon-text);
    padding: 18px 35px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(2, 174, 214, 0.3);
    margin: 0;
    position: relative;
    overflow: hidden;
    width: auto;
    min-width: 300px;
    white-space: nowrap;
}

.submit-btn:hover {
    background: linear-gradient(45deg, var(--neon-secondary), var(--neon-primary));
    box-shadow: 0 4px 15px rgba(0, 136, 255, 0.3);
    transform: translateY(-1px);
}

.submit-btn:disabled {
    background: #1a1a1a;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
}

:root[data-theme="light"] .submit-btn {
    color: white;
    box-shadow: 0 2px 5px rgba(0, 136, 255, 0.2);
}

:root[data-theme="light"] .submit-btn:hover {
    box-shadow: 0 4px 15px rgba(0, 136, 255, 0.3);
}

:root[data-theme="light"] .submit-btn:disabled {
    background: #e0e0e0;
    color: #999;
    border: none;
}

.supported-formats {
    margin: 0;
    text-align: center;
    color: var(--neon-gray);
    font-size: 1em;
    font-weight: 500;
    text-shadow: 0 0 3px rgba(2, 174, 214, 0.3),
                 0 0 6px rgba(2, 174, 214, 0.2),
                 0 0 9px rgba(2, 174, 214, 0.1);
    letter-spacing: 0.5px;
}

:root[data-theme="light"] .supported-formats {
    color: var(--neon-text);
    text-shadow: 0 0 3px rgba(0, 136, 255, 0.2),
                 0 0 6px rgba(0, 136, 255, 0.1),
                 0 0 9px rgba(0, 136, 255, 0.05);
}

.made-by {
    margin-top: 20px;
    padding: 0;
    height: 60px;
    background: linear-gradient(90deg,
        rgba(5, 5, 5, 1) 0%,
        rgba(0, 10, 40, 1) 10%,
        rgba(0, 5, 20, 1) 90%,
        rgba(5, 5, 5, 1) 100%);
    border-radius: 8px;
    text-align: center;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    width: 100%;
    box-sizing: border-box;
}

.made-by::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.03),
        transparent
    );
    transform: rotate(45deg);
    animation: shine 6s infinite 3s;
}

.made-by a {
    color: var(--neon-text);
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-shadow: 0 0 5px rgba(2, 174, 214, 0.2);
    position: relative;
    z-index: 1;
    opacity: 0.9;
    transition: all 0.3s ease;
    background: linear-gradient(45deg, var(--neon-primary), var(--neon-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 2px 4px;
    border-radius: 4px;
}

.made-by a:hover {
    text-decoration: none;
    opacity: 1;
    transform: translateY(-1px);
    text-shadow: 0 0 8px rgba(2, 174, 214, 0.4);
    background: linear-gradient(45deg, var(--neon-secondary), var(--neon-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

:root[data-theme="light"] .made-by a {
    background: linear-gradient(45deg, var(--neon-primary), var(--neon-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 5px rgba(0, 136, 255, 0.15);
}

:root[data-theme="light"] .made-by a:hover {
    background: linear-gradient(45deg, var(--neon-secondary), var(--neon-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 8px rgba(0, 136, 255, 0.25);
}

.made-by p {
    font-size: 0.85em;
    letter-spacing: 0.3px;
    line-height: 1.4;
    margin: 0;
    padding: 0 15px;
    white-space: nowrap;
    color: rgba(44, 62, 80, 0.7);
}

#status {
    margin-top: 30px;
    text-align: center;
    color: var(--neon-text);
    font-size: 1.1em;
    text-shadow: 0 0 3px rgba(0, 136, 255, 0.3),
                 0 0 6px rgba(0, 136, 255, 0.2),
                 0 0 9px rgba(0, 136, 255, 0.1);
    letter-spacing: 2px;
    font-weight: bold;
}

#status.error {
    text-shadow: 0 0 3px rgba(255, 0, 0, 0.3),
                 0 0 6px rgba(255, 0, 0, 0.2),
                 0 0 9px rgba(255, 0, 0, 0.1);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background-color: rgba(0, 136, 255, 0.1);
    border-radius: 3px;
    margin-top: 25px;
    display: none;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-primary), var(--neon-secondary));
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease-in-out;
    box-shadow: 0 0 10px rgba(0, 136, 255, 0.3);
}

/* Анимация пульсации для заголовка */
@keyframes pulse {
    0% { text-shadow: 0 0 3px var(--neon-primary),
                 0 0 6px var(--neon-primary),
                 0 0 9px var(--neon-primary); }
    50% { text-shadow: 0 0 4px var(--neon-primary),
                 0 0 7px var(--neon-primary),
                 0 0 11px var(--neon-primary); }
    100% { text-shadow: 0 0 3px var(--neon-primary),
                 0 0 6px var(--neon-primary),
                 0 0 9px var(--neon-primary); }
}

/* Стилизация скроллбара */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--neon-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neon-secondary);
}

:root[data-theme="light"] .container {
    box-shadow: 0 0 15px rgba(0, 136, 255, 0.08),
                0 0 30px rgba(0, 162, 255, 0.03);
    border: 1px solid rgba(0, 136, 255, 0.08);
}

:root[data-theme="light"] .file-input {
    border: 2px dashed rgba(0, 136, 255, 0.2);
    background: rgba(0, 136, 255, 0.03);
}

:root[data-theme="light"] .file-input:hover {
    border-color: var(--neon-primary);
    box-shadow: 0 0 15px rgba(0, 136, 255, 0.15);
    background: rgba(0, 136, 255, 0.05);
}

:root[data-theme="light"] .custom-file-upload {
    background: linear-gradient(45deg, var(--neon-primary), var(--neon-secondary));
    box-shadow: 0 2px 5px rgba(0, 136, 255, 0.15);
}

:root[data-theme="light"] .custom-file-upload:hover {
    box-shadow: 0 4px 15px rgba(0, 136, 255, 0.2);
}

:root[data-theme="light"] .submit-btn {
    color: white;
    box-shadow: 0 2px 5px rgba(0, 136, 255, 0.15);
}

:root[data-theme="light"] .submit-btn:hover {
    box-shadow: 0 4px 15px rgba(0, 136, 255, 0.2);
}

:root[data-theme="light"] .made-by {
    background: linear-gradient(90deg,
        rgba(248, 249, 250, 0.75) 0%,
        rgba(0, 136, 255, 0.15) 10%,
        rgba(0, 162, 255, 0.15) 90%,
        rgba(248, 249, 250, 0.75) 100%);
}

:root[data-theme="light"] #status {
    text-shadow: 0 0 3px rgba(0, 136, 255, 0.2),
                 0 0 6px rgba(0, 136, 255, 0.1),
                 0 0 9px rgba(0, 136, 255, 0.05);
}

:root[data-theme="light"] .progress-bar {
    background-color: rgba(0, 136, 255, 0.08);
}

:root[data-theme="light"] .progress-bar-fill {
    box-shadow: 0 0 10px rgba(0, 136, 255, 0.2);
}

.slide-image {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.slide {
    margin-bottom: 40px;
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: relative;
    page-break-after: always;
}

.slide:last-child {
    margin-bottom: 0;
}

.slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--neon-primary), var(--neon-secondary));
    border-radius: 12px 12px 0 0;
}

.slide-content {
    margin: 0;
    line-height: 1.6;
}

.slide-notes {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
    border-left: 3px solid var(--neon-primary);
}

.page {
    margin-bottom: 40px;
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: relative;
    page-break-after: always;
}

.page:last-child {
    margin-bottom: 0;
}

.page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--neon-primary), var(--neon-secondary));
    border-radius: 12px 12px 0 0;
}

.page-content {
    margin: 0;
    line-height: 1.6;
}

@media print {
    .slide, .page {
        margin: 0;
        padding: 20px;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

.slide-content {
    padding: 0;
    border-radius: 0;
    overflow: visible;
    border: none;
}

.slide-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border: none;
}

.slide-content table {
    width: 100%;
    max-width: 1000px;
    border-collapse: collapse;
    margin: 1em 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.slide-content table td,
.slide-content table th {
    border: 1px solid #dee2e6;
    padding: 8px;
    word-wrap: break-word;
    max-width: 1000px;
}

.slide-content p {
    margin: 0 0 1em 0;
    line-height: 1.6;
    max-width: 1000px;
}

.pdf-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.pdf-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pdf-text {
    margin-top: 20px;
    line-height: 1.6;
    color: #333;
    font-size: 16px;
    text-align: left;
    word-wrap: break-word;
}

/* --- Минималистичный стиль для Word --- */
.word-page {
    background: #fff;
    border: 1px solid #ccc;
    margin: 32px auto;
    padding: 40px 36px;
    max-width: 794px; /* A4 width in px at 96dpi */
    width: 100%;
    height: 1122px; /* A4 height in px at 96dpi */
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
}
.word-content {
    font-family: Arial, sans-serif;
    font-size: 16px;
    color: #222;
    line-height: 1.6;
    width: 100%;
    height: 100%;
    overflow: visible;
}
.word-content img {
    max-width: 800px;
    width: 100%;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-top: 16px;
    margin-bottom: 16px;
}
.word-text {
    width: 100%;
    height: 100%;
    overflow: visible;
}
/* --- Конец стиля для Word --- */

/* --- Стиль для Word в стиле PDF --- */
.word-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}
.word-content img {
    max-width: 1000px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.word-text {
    margin-top: 20px;
    line-height: 1.6;
    color: #333;
    font-size: 16px;
    text-align: left;
    word-wrap: break-word;
}
/* --- Конец стиля для Word в стиле PDF --- */ 