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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

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

/* Навигация */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-brand h1 {
    color: #667eea;
    font-size: 1.8em;
    font-weight: 700;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-link {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.nav-link.active {
    color: white;
    background: #667eea;
}

/* Заголовок */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h2 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* Карточки */
.card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.card h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 600;
}

/* Формы */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input[type="url"] {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input[type="url"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.url-example {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* Радио кнопки */
.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.radio-label:hover {
    background: #f8f9fa;
}

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

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: #667eea;
    background: #667eea;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Кнопки */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e9ecef;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Результат */
.result-content {
    text-align: center;
}

.success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 600;
}

.short-url {
    margin: 20px 0;
}

.short-url a {
    color: #667eea;
    font-size: 1.2em;
    font-weight: 600;
    text-decoration: none;
    word-break: break-all;
}

.short-url a:hover {
    text-decoration: underline;
}

.qr-code {
    margin: 20px 0;
}

.qr-code img {
    max-width: 200px;
    border: 10px solid white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.result-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* Статистика */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.stat-number {
    font-size: 3em;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1.1em;
    opacity: 0.9;
}

.controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.controls-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Таблица */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
}

tr:hover {
    background: #f8f9fa;
}

.status-active {
    color: #28a745;
    font-weight: 600;
}

.status-inactive {
    color: #dc3545;
    font-weight: 600;
}

.status-expired {
    color: #ffc107;
    font-weight: 600;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #333;
}

/* Быстрая статистика */
.quick-stats {
    text-align: center;
}

.quick-stats p {
    margin-bottom: 20px;
    color: #666;
}

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

    .navbar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .nav-links {
        justify-content: center;
    }

    .header h2 {
        font-size: 2em;
    }

    .card {
        padding: 20px;
    }

    .radio-group {
        flex-direction: column;
        gap: 10px;
    }

    .result-actions {
        flex-direction: column;
    }

    .controls-header {
        flex-direction: column;
        text-align: center;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    th, td {
        padding: 10px;
        font-size: 14px;
    }

    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 20px;
    }
}
/* Переключатель типа результата */
.toggle-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.toggle-bg {
    display: flex;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 5px;
    position: relative;
    border: 2px solid #e9ecef;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.toggle-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: none;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
    position: relative;
    color: #6c757d;
    font-weight: 500;
}

.toggle-option.active {
    color: #333;
}

.toggle-slider {
    position: absolute;
    top: 5px;
    left: 5px;
    width: calc(50% - 5px);
    height: calc(100% - 10px);
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 1;
}

.toggle-bg[data-type="file"] .toggle-slider {
    transform: translateX(100%);
}

.toggle-icon {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.toggle-option.active .toggle-icon {
    transform: scale(1.1);
}

.toggle-option:hover {
    color: #667eea;
}

/* Анимация для переключателя */
@keyframes toggleSlide {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

.toggle-bg[data-type="file"] .toggle-slider {
    animation: toggleSlide 0.3s ease;
}

/* Скрытое поле для хранения выбранного типа */
.hidden-input {
    display: none;
}

/* Информация о времени истечения */
.expiry-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 12px;
    color: #856404;
    font-weight: 500;
    margin: 20px 0;
}

.clock-icon {
    font-size: 18px;
}

.expiry-time {
    font-weight: 600;
}

/* Адаптивность для переключателя */
@media (max-width: 768px) {
    .toggle-bg {
        flex-direction: column;
        width: 100%;
    }

    .toggle-slider {
        display: none;
    }

    .toggle-option {
        justify-content: center;
        padding: 15px 20px;
    }
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 15px;
}

#userInfo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
    font-weight: 500;
}

/* Адаптивность для аутентификации */
@media (max-width: 768px) {
    .nav-auth {
        margin-top: 15px;
        justify-content: center;
    }
}

/* Стили для модального окна регистрации */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: black;
}

#registerForm .form-group {
    margin-bottom: 15px;
}

#registerForm label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

#registerForm input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

#registerForm button {
    width: 100%;
}

/* Стили для модальных окон */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 450px;
    position: relative;
    animation: slideDown 0.3s ease;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
    font-size: 1.5em;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    position: absolute;
    right: 15px;
    top: 15px;
}

.close:hover {
    color: #e53e3e;
}

/* Стили для форм в модальных окнах */
.modal .form-group {
    margin-bottom: 20px;
}

.modal label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.modal input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.modal input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal button {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    margin-top: 10px;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Адаптивность */
@media (max-width: 768px) {
    .modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 95%;
    }
}