/* SecretNote - Единый современный дизайн */

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #6366f1;
    --success: #10b981;
    --success-light: #34d399;
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --error: #ef4444;
    --error-light: #f87171;
    /* Светлая тема по умолчанию */
    --bg: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #f8fafc;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* Тёмная тема */
[data-theme="dark"] {
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #475569;
    --shadow: rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
}

body {
    background: var(--bg);
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    margin: 0;
    padding: 0;
}

[data-theme="dark"] body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Основная карточка */
.card {
    background: var(--bg-card);
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 25px 50px -12px var(--shadow);
    overflow: hidden;
}

.card:hover {
    transform: none;
    box-shadow: 0 25px 50px -12px var(--shadow);
}

/* Заголовок */
.card-header.header-main {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 32px 24px;
    text-align: center;
    border: none;
}

.card-header h2 {
    margin: 0 0 8px 0;
    font-size: 1.75rem;
    font-weight: 700;
}

.card-header p {
    margin: 0;
    opacity: 0.85;
    font-size: 0.95rem;
}

.logo-link {
    color: white !important;
    text-decoration: none !important;
    transition: opacity 0.2s;
}

.logo-link:hover {
    opacity: 0.9;
    color: white !important;
}

.logo-link:before {
    display: none;
}

/* Контент карточки */
.card-body {
    padding: 32px;
}

/* Типография */
h3 {
    color: var(--text);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

p.text-muted, .text-muted {
    color: var(--text-muted) !important;
}

/* Статичные иконки (без анимации) */
.static-icon-container {
    margin: 20px 0;
}

.static-icon {
    width: 90px;
    height: 90px;
    margin: 0 auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.static-icon i {
    font-size: 2.2rem;
    color: white;
}

.static-icon-success {
    background: linear-gradient(135deg, var(--success), var(--success-light));
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}

.static-icon-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.3);
}

/* Анимированный круг (замок/успех/ошибка) */
.secret-note-hero,
.success-animation-container {
    margin: 20px 0;
}

.lock-animation-container {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto;
}

.lock-circle,
.success-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 15px 40px rgba(79, 70, 229, 0.5);
    z-index: 2;
}

.lock-circle i,
.success-circle i {
    font-size: 2.5rem;
    color: white;
    animation: iconPulse 2s ease-in-out infinite;
}

.lock-pulse,
.success-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.3);
    animation: ringPulse 2s ease-out infinite;
}

.lock-pulse::before,
.lock-pulse::after,
.success-pulse::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    animation: ringPulse 2s ease-out infinite;
}

.lock-pulse::before { animation-delay: 0.4s; }
.lock-pulse::after { animation-delay: 0.8s; }
.success-pulse::before { animation-delay: 0.5s; }

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

@keyframes ringPulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

/* Цветовые варианты */
.lock-circle-success,
.success-circle {
    background: linear-gradient(135deg, var(--success), var(--success-light)) !important;
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.5) !important;
}

.lock-pulse-success,
.success-pulse {
    background: rgba(16, 185, 129, 0.3) !important;
}

.lock-circle-warning {
    background: linear-gradient(135deg, var(--warning), var(--warning-light)) !important;
    box-shadow: 0 15px 40px rgba(245, 158, 11, 0.5) !important;
}

.lock-pulse-warning {
    background: rgba(245, 158, 11, 0.3) !important;
}

.lock-circle-error {
    background: linear-gradient(135deg, var(--error), var(--error-light)) !important;
    box-shadow: 0 15px 40px rgba(239, 68, 68, 0.5) !important;
}

.lock-pulse-error {
    background: rgba(239, 68, 68, 0.3) !important;
}

/* Главная кнопка */
.btn-reveal-note {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 16px 40px;
    border-radius: 14px;
    border: none;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.4);
    transition: all 0.3s ease;
}

.btn-reveal-note:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(79, 70, 229, 0.5);
}

/* Кнопка primary */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    font-weight: 600;
    color: white;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(79, 70, 229, 0.4);
}

/* Карточка с содержимым заметки */
.note-content-card {
    background: var(--bg-input);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.note-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-success {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

.note-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.note-content-body {
    padding: 24px;
}

.section-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 14px;
}

.section-label i {
    color: var(--primary-light);
}

.note-text-content {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border);
}

.note-text {
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
}

/* Секция с файлами */
.note-files-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.attached-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 14px;
}

.attached-file-card {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s ease;
}

.attached-file-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
}

.file-preview {
    height: 90px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.file-icon-container {
    height: 90px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-icon {
    font-size: 2.5rem;
    color: var(--primary-light);
}

.preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.file-info-container {
    padding: 12px;
}

.file-name-text {
    font-weight: 500;
    color: var(--text);
    font-size: 0.8rem;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}

.file-size-badge {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg);
    padding: 3px 8px;
    border-radius: 10px;
    display: inline-block;
}

.download-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.8rem;
    text-decoration: none;
    margin-top: 10px;
    transition: all 0.2s ease;
}

.download-button:hover {
    background: var(--primary-dark);
    color: white;
}

.files-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(245, 158, 11, 0.15);
    border-radius: 10px;
    color: var(--warning-light);
    font-size: 0.85rem;
}

/* Форма ввода пароля */
.password-form-modern {
    max-width: 320px;
    margin: 0 auto;
}

.password-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-group > i {
    position: absolute;
    left: 18px;
    color: var(--text-muted);
    font-size: 1rem;
    z-index: 1;
}

.password-input-group input {
    width: 100%;
    padding: 16px 16px 16px 50px;
    border: 2px solid var(--border);
    border-radius: 14px;
    font-size: 1rem;
    background: var(--bg-input);
    color: var(--text);
    transition: all 0.3s ease;
}

.password-input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
}

.password-input-group input::placeholder {
    color: var(--text-muted);
}

.error-message {
    display: inline-flex;
    align-items: center;
    padding: 12px 20px;
    background: rgba(239, 68, 68, 0.15);
    color: var(--error-light);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Форма создания заметки */
.form-label {
    color: var(--text);
    font-weight: 500;
    margin-bottom: 8px;
}

.form-control {
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    color: var(--text);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    background: var(--bg-input);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
    color: var(--text);
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

.form-check-input {
    background-color: var(--bg-input);
    border-color: var(--border);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-label {
    color: var(--text);
}

/* Кнопка копирования */
.btn-copy {
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-copy:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* URL заметки */
.note-url {
    background: var(--bg-input);
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin: 16px 0;
    word-break: break-all;
}

.url-display {
    color: var(--primary-light);
    font-family: monospace;
    font-size: 0.95rem;
}

/* Иконка-замок (для страницы "создана заметка") */
.icon-lock {
    font-size: 4rem;
    color: var(--success);
    margin: 20px 0;
}

/* Алерты */
.alert {
    border-radius: 12px;
    border: none;
    padding: 16px 20px;
}

.alert-info {
    background: rgba(79, 70, 229, 0.15);
    color: var(--primary-light);
}

/* Футер */
.footer {
    text-align: center;
    padding: 30px 0;
    color: var(--text-muted);
}

.footer a {
    color: var(--primary-light);
    text-decoration: none;
}

.footer a:hover {
    color: var(--primary);
}

/* Кнопки дополнительные */
.btn-outline-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 10px;
    padding: 8px 16px;
    transition: all 0.2s ease;
}

.btn-outline-secondary:hover {
    background: var(--bg-input);
    border-color: var(--text-muted);
    color: var(--text);
}

/* Сообщение о копировании */
.copied-message {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--success);
    color: white;
    padding: 14px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.copied-message.show {
    transform: translateY(0);
    opacity: 1;
}

/* Модальное окно для изображений */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
}

.image-modal.show {
    display: flex;
}

.modal-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 1001;
    transition: opacity 0.2s;
}

.modal-close:hover {
    opacity: 0.7;
}

/* Загруженные файлы в форме */
.uploaded-files-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.uploaded-file-item {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    width: 100%;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 20px 12px;
    }

    .card {
        border-radius: 20px;
    }

    .card-header.header-main {
        padding: 24px 16px;
    }

    .card-body {
        padding: 24px 16px;
    }

    .lock-animation-container {
        width: 120px;
        height: 120px;
    }

    .lock-circle,
    .success-circle {
        width: 80px;
        height: 80px;
    }

    .lock-circle i,
    .success-circle i {
        font-size: 2rem;
    }

    .lock-pulse,
    .success-pulse {
        width: 80px;
        height: 80px;
    }

    .btn-reveal-note {
        padding: 14px 32px;
        font-size: 1rem;
        width: 100%;
    }

    .attached-files-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 16px 8px;
    }

    .card-body {
        padding: 20px 14px;
    }

    .note-content-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .attached-files-grid {
        grid-template-columns: 1fr;
    }
}

/* Анимация появления */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn 0.5s ease-out;
}

/* Кнопка переключения темы в header */
.header-content {
    position: relative;
}

.theme-toggle {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.theme-toggle .fa-sun {
    display: none;
}

.theme-toggle .fa-moon {
    display: block;
}

[data-theme="dark"] .theme-toggle .fa-sun {
    display: block;
}

[data-theme="dark"] .theme-toggle .fa-moon {
    display: none;
}

@media (max-width: 480px) {
    .theme-toggle {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}
