/* Глобальные стили */
:root {
    --primary-color: #2c4f51;
    --accent-color: #2c4f51;
    --primary-hover: #3d6365;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Login Screen */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #3d6365 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-container {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    animation: slideIn 0.4s ease-out;
}

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

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    color: var(--primary-color);
    margin: 15px 0 5px 0;
    font-size: 1.8rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

.login-form {
    margin-top: 25px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.login-form input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.login-form input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 79, 81, 0.1);
}

.login-error {
    color: var(--danger-color);
    background: #fee2e2;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    display: none;
}

.login-error.show {
    display: block;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #3d6365 100%);
    color: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

header img {
    height: 60px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: 15px;
}

.header-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
}

#sync-indicator {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

#sync-indicator.syncing {
    color: var(--primary-color) !important;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.tab-button {
    background: none;
    border: none;
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 8px 8px 0 0;
}

.tab-button:hover {
    background-color: rgba(37, 99, 235, 0.05);
    color: var(--primary-color);
}

.tab-button.active {
    color: var(--primary-color);
    background-color: var(--card-bg);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--primary-color);
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

/* Form Container */
.form-container {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.form-container h2 {
    margin-bottom: 25px;
    color: var(--text-primary);
    font-size: 1.75rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

input[type="text"],
input[type="number"],
input[type="date"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: white;
    color: #1e293b;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

small {
    display: block;
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Buttons */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-danger:hover {
    background-color: #dc2626;
}

/* Videos List */
.videos-list {
    margin-top: 40px;
}

.videos-list h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

#saved-videos-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.video-item {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.video-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-lg);
}

.video-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
    gap: 15px;
}

.video-item h4 {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.video-item-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.video-item-info p {
    margin: 3px 0;
}

.video-item-info strong {
    color: var(--text-primary);
}

/* Schedule Container */
.schedule-container {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.schedule-header h2 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.schedule-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(44, 79, 81, 0.35) 0%, rgba(44, 79, 81, 0.35) 100%);
    border: 1px solid rgba(44, 79, 81, 0.5);
    padding: 20px;
    border-radius: 10px;
    color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-label {
    font-size: 0.9rem;
    color: #4a5568;
    font-weight: 500;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Validation Alerts */
#validation-alerts {
    margin-bottom: 20px;
}

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

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

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

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

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--warning-color);
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

.alert-success {
    background-color: #a7f3d0;
    color: #064e3b;
    border-left: 4px solid var(--success-color);
    font-weight: 500;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--accent-color);
}

/* Saved Videos Section */
.saved-videos-section {
    margin-bottom: 30px;
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.saved-videos-section h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

#all-videos-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 15px;
}

.video-card-mini {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.video-card-mini:hover {
    transform: translateX(3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.video-card-mini h4 {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-card-mini-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.video-card-mini-info span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Timeline */
.timeline-container {
    margin-bottom: 40px;
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.timeline-container h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.timeline-wrapper {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.timeline-labels {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 70px;
    max-height: 900px;
    overflow-y: scroll;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.timeline-labels::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.timeline-label {
    height: 180px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding-right: 10px;
    padding-top: 5px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
    border-right: 2px solid var(--primary-color);
    flex-shrink: 0;
}

.timeline-track {
    flex: 1;
    position: relative;
    background: #fafafa;
    border-radius: 8px;
    max-height: 900px;
    overflow-y: auto;
    overflow-x: hidden;
}

.timeline-grid {
    position: relative;
    min-height: 1830px;
    display: flex;
    flex-direction: column;
}

.timeline-grid.dragging-over {
    cursor: copy;
}

.timeline-segment {
    height: 30px;
    border-bottom: 1px solid #e5e5e5;
    position: relative;
    flex-shrink: 0;
}

.timeline-segment:nth-child(6n) {
    border-bottom: 2px solid var(--primary-color);
    opacity: 0.3;
}

.timeline-segment:nth-child(even) {
    background: rgba(44, 79, 81, 0.02);
}

.timeline-item {
    position: absolute;
    background: linear-gradient(135deg, var(--primary-color) 0%, #3d6365 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: grab;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid #1a3537;
    transition: all 0.2s ease;
    z-index: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    user-select: none;
}

.timeline-item:active {
    cursor: grabbing;
}

.timeline-item:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    transform: translateX(-2px);
    z-index: 2;
    border-left: 4px solid #03e9f4;
}

.timeline-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(44, 79, 81, 0.4);
    z-index: 999;
    border: 2px solid var(--accent-color);
}

.timeline-item.drag-over {
    border: 2px solid var(--primary-color);
    background: linear-gradient(135deg, rgba(44, 79, 81, 0.3) 0%, rgba(44, 79, 81, 0.3) 100%);
}

.timeline-item-title {
    font-weight: 600;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
}


.timeline-placeholder {
    position: absolute;
    background: rgba(44, 79, 81, 0.2);
    border: 2px dashed var(--primary-color);
    border-radius: 6px;
    pointer-events: none;
    z-index: 5;
}

.timeline-drop-indicator {
    position: absolute;
    left: 5px;
    right: 5px;
    background: rgba(44, 79, 81, 0.25);
    border: 3px dashed var(--accent-color);
    border-radius: 10px;
    pointer-events: none;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-color);
    box-shadow: 0 0 20px rgba(44, 79, 81, 0.6), inset 0 0 15px rgba(44, 79, 81, 0.3);
    animation: pulse-indicator 0.8s ease-in-out infinite;
    transition: all 0.1s ease;
}

@keyframes pulse-indicator {
    0%, 100% {
        box-shadow: 0 0 20px rgba(44, 79, 81, 0.6), inset 0 0 15px rgba(44, 79, 81, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(44, 79, 81, 0.8), inset 0 0 20px rgba(44, 79, 81, 0.4);
    }
}

.timeline-drop-indicator.invalid {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    color: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6), inset 0 0 15px rgba(239, 68, 68, 0.3);
    animation: shake-indicator 0.3s ease-in-out;
}

@keyframes shake-indicator {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.timeline-drop-indicator.valid {
    background: rgba(16, 185, 129, 0.25);
    border-color: #10b981;
    color: #10b981;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.6), inset 0 0 15px rgba(16, 185, 129, 0.3);
}

.timeline-current-time {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #ef4444;
    z-index: 10;
    pointer-events: none;
}

.timeline-current-time::before {
    content: '';
    position: absolute;
    left: 0;
    top: -4px;
    width: 10px;
    height: 10px;
    background-color: #ef4444;
    border-radius: 50%;
}

.timeline-empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-secondary);
    font-size: 1rem;
    width: 100%;
}

.timeline-empty-state p {
    margin: 10px 0;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-active {
    background-color: rgba(16, 185, 129, 0.2);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.5);
}

.status-upcoming {
    background-color: rgba(245, 158, 11, 0.2);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.5);
}

.status-expired {
    background-color: rgba(239, 68, 68, 0.2);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.5);
}

/* Status badges */
.status-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.status-active {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.status-active.social {
    background-color: #a7f3d0;
    color: #064e3b;
    border: 1px solid #059669;
}

.status-upcoming {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.status-expired {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* Responsive */

/* Планшеты (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }
    
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #all-videos-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Мобильные устройства (до 768px) */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    /* Header */
    header {
        padding: 20px 15px;
        margin-bottom: 20px;
        border-radius: 12px;
    }
    
    header img {
        height: 40px !important;
    }
    
    header h1 {
        font-size: 1.5rem !important;
    }
    
    .subtitle {
        font-size: 0.85rem;
        display: none; /* Скрываем подзаголовок на мобильных */
    }
    
    .header-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .header-actions .btn {
        width: 100%;
        font-size: 0.9rem;
        padding: 10px 16px;
    }
    
    #sync-indicator {
        font-size: 0.75rem;
        text-align: center;
    }
    
    /* Tabs */
    .tabs {
        flex-direction: row;
        overflow-x: auto;
        gap: 5px;
        margin-bottom: 15px;
    }
    
    .tab-button {
        flex: 1;
        min-width: 150px;
        font-size: 0.9rem;
        padding: 12px 15px;
        white-space: nowrap;
    }
    
    /* Forms */
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .form-group input,
    .form-group select {
        font-size: 0.95rem;
        padding: 10px 12px;
    }
    
    .form-group small {
        font-size: 0.75rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .btn {
        font-size: 0.95rem;
        padding: 12px 20px;
    }
    
    /* Stats */
    .stats {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 1.8rem;
    }
    
    .stat-label {
        font-size: 0.85rem;
    }
    
    /* Timeline */
    .timeline-container {
        padding: 15px;
        overflow-x: hidden;
    }
    
    .timeline-container h3 {
        font-size: 1.1rem;
    }
    
    .timeline-container p,
    .timeline-container button {
        font-size: 0.8rem !important;
    }
    
    .timeline-container > div[style*="display: flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    
    .timeline-container > div[style*="display: flex"] button {
        width: 100% !important;
        margin: 0 !important;
    }
    
    .timeline-container > div[style*="display: flex"] p {
        text-align: center;
        width: 100% !important;
    }
    
    .timeline-wrapper {
        flex-direction: row;
        overflow-x: auto;
    }
    
    .timeline-labels {
        min-width: 55px;
        max-width: 55px;
        max-height: 600px;
        overflow-y: auto; /* Изменено на auto для лучшей совместимости */
        scrollbar-width: none;
        touch-action: pan-y; /* Разрешаем вертикальную прокрутку на тач-устройствах */
        -webkit-overflow-scrolling: touch; /* Плавная прокрутка на iOS */
    }
    
    .timeline-labels::-webkit-scrollbar {
        display: none;
    }
    
    .timeline-label {
        font-size: 0.7rem;
        height: 180px; /* Сохраняем правильную высоту для синхронизации */
        padding-right: 5px;
        padding-top: 3px;
        align-items: flex-start;
        justify-content: flex-end;
    }
    
    .timeline-track {
        min-width: calc(100vw - 105px);
        max-height: 600px;
        touch-action: pan-y; /* Разрешаем вертикальную прокрутку на тач-устройствах */
        -webkit-overflow-scrolling: touch; /* Плавная прокрутка на iOS */
    }
    
    .timeline-item {
        padding: 8px 10px;
    }
    
    .timeline-item-title {
        font-size: 0.75rem !important;
    }
    
    /* Video cards */
    .video-item {
        padding: 15px;
    }
    
    .video-item-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px;
    }
    
    .video-item-header h3 {
        font-size: 1rem;
        margin-bottom: 5px;
    }
    
    .status-badge {
        margin-left: 0 !important;
        margin-top: 0;
        font-size: 0.75rem;
        padding: 4px 10px;
    }
    
    .video-item-info {
        font-size: 0.85rem;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    
    .video-item-info span {
        display: block;
        padding: 5px 0;
    }
    
    .video-item-actions {
        flex-direction: row;
        gap: 8px;
    }
    
    .video-item-actions .btn {
        flex: 1;
        font-size: 0.85rem;
        padding: 8px 12px;
    }
    
    /* Video cards mini */
    #all-videos-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .video-card-mini {
        padding: 12px;
    }
    
    .video-card-mini h4 {
        font-size: 0.95rem;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .video-card-mini-info {
        font-size: 0.8rem;
        flex-wrap: wrap;
    }
    
    /* Alerts */
    .alert {
        font-size: 0.85rem;
        padding: 12px;
    }
}

/* Малые мобильные устройства (до 480px) */
@media (max-width: 480px) {
    .container {
        padding: 8px;
    }
    
    header {
        padding: 15px 10px;
    }
    
    header img {
        height: 35px !important;
    }
    
    header h1 {
        font-size: 1.2rem !important;
    }
    
    .tab-button {
        min-width: 120px;
        font-size: 0.85rem;
        padding: 10px 12px;
    }
    
    .form-group input,
    .form-group select {
        font-size: 0.9rem;
        padding: 8px 10px;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 10px 16px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    /* Временная шкала - еще более компактно */
    .timeline-container {
        padding: 10px;
    }
    
    .timeline-container h3 {
        font-size: 1rem;
    }
    
    .timeline-labels {
        min-width: 50px;
        max-width: 50px;
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
    }
    
    .timeline-label {
        font-size: 0.65rem;
        padding-right: 3px;
    }
    
    .timeline-track {
        min-width: calc(100vw - 90px);
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
    }
    
    .timeline-item {
        padding: 6px 8px;
    }
    
    .timeline-item-title {
        font-size: 0.7rem !important;
        line-height: 1.2 !important;
    }
    
    .video-item {
        padding: 12px;
    }
    
    .video-item-header h3 {
        font-size: 0.95rem;
    }
}


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

.modal-content {
    background-color: var(--card-background);
    margin: 3% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    padding: 25px 30px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e4a4d 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    font-size: 2rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    line-height: 1;
    transition: all 0.3s ease;
}

.modal-close:hover {
    transform: rotate(90deg);
    color: #ff6b6b;
}

.modal-content form {
    padding: 30px;
}

/* Непрозрачность полей в модальном окне */
#edit-modal .modal-content {
    background-color: #ffffff !important;
    opacity: 1 !important;
}

#edit-modal .modal-content form {
    background-color: #ffffff !important;
    border-radius: 0 0 12px 12px;
}

#edit-modal input[type="text"],
#edit-modal input[type="number"],
#edit-modal input[type="date"] {
    background-color: #ffffff !important;
    opacity: 1 !important;
    color: #000000 !important;
}

#edit-modal .form-group {
    opacity: 1 !important;
}

#edit-modal label {
    opacity: 1 !important;
    color: #2c4f51 !important;
}
