/* =========== ОБЩИЕ СТИЛИ =========== */

/* Кнопки действий (таблицы, файлы) */
.btn-download,
.btn-edit,
.btn-view,
.btn-delete {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-download {
    background: #3498db;
    color: white;
}

.btn-edit {
    background: #f39c12;
    color: white;
}

.btn-view {
    background: #2ecc71;
    color: white;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

.btn-download:hover,
.btn-edit:hover,
.btn-view:hover,
.btn-delete:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}



/* =========== ЛИЧНЫЙ КАБИНЕТ =========== */
.giflix-login-required {
    max-width: 500px;
    margin: 50px auto;
    padding: 40px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    text-align: center;
}

.login-required-message h2 {
    color: #999;
    margin-bottom: 15px;
}

.login-required-message p {
    color: #666;
    margin-bottom: 30px;
}

.login-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Дашборд */
.giflix-account-dashboard {
    /* background: #ffffff; */
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    max-width: 1140px;
    margin: 0 auto;
}

.account-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    display: flex;
    align-items: center;
    gap: 30px;
}

.user-avatar img {
    width: 100px;
    height: auto;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.3);
}

.user-info h1 {
    margin: 0 0 5px 0;
    font-size: 28px;
}

.user-info p {
    margin: 5px 0;
    opacity: 0.9;
}

/* Табы */
.account-tabs {
    width: 100%;
    display: flex;
    min-height: 500px;
}

.tab-navigation {
    width: 20%;
    /* background: #232136; */
    border-right: 1px solid #1b1a26;
    padding: 20px 0;
}

.tab-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    text-decoration: none;
    color: #4d7198;
    border-left: 3px solid transparent;
    transition: all 0.3s;
}

.tab-link:hover {
    background: #4d7198;
    color: #fff;
}

.tab-link.active {
    background: #4d7198;
    color: #e9ecef;
    border-left-color: #3498db;
    font-weight: 600;
}

.tab-link.logout {
    color: #e74c3c;
    margin-top: auto;
}

.tab-link i {
    width: 20px;
    text-align: center;
}

.tab-badge {
    background: #e74c3c;
    color: white;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
}

.tab-content {
    flex: 1;
    padding: 20px 10px;
    width: 80%;
    min-height: 400px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Формы профиля */
.profile-edit-form {
    max-width: 600px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
}

.password-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e9ecef;
}

.password-change-form {
    max-width: 500px;
    margin: 0 auto;
}

.password-change-form h3 {
    margin-bottom: 20px;
    color: #c3c4c7;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* Сетка избранного */
.giflix-favorites-grid,
.giflix-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.giflix-favorite-item,
.giflix-grid-item, .files-grid-item {
    /* background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1); */
    /* background: #1b1a26; */
    /* border: 1px solid #1b1a26; */
    /* border-radius: 10px; */
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.giflix-favorite-item:hover,
.giflix-grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.favorite-thumbnail,
.grid-item-image-container {
    height: 180px;
    overflow: hidden;
    position: relative;
}

.favorite-thumbnail img,
.grid-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.giflix-favorite-item:hover .favorite-thumbnail img,
.giflix-grid-item:hover .grid-item-image {
    transform: scale(1.05);
}

.favorite-content,
.grid-item-content {
    padding: 20px;
}

.favorite-content h3,
.grid-item-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    line-height: 1.4;
}

.favorite-content h3 a,
.grid-item-title a {
    color: #c3c4c7;
    text-decoration: none;
    transition: color 0.3s;
}

.favorite-content h3 a:hover,
.grid-item-title a:hover {
    color: #999;
}

.post-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
}

.favorite-meta,
.grid-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.giflix-remove-favorite,
.remove-favorite-btn {
    background: none;
    border: none;
    /* color: #e74c3c; */
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    background: #e74c3c;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
}

.giflix-remove-favorite:hover,
.remove-favorite-btn:hover {
    /* color: #c0392b; */
    background: #c0392b;
}

.giflix-no-favorites {
    text-align: center;
    padding: 60px 20px;
}

.giflix-no-favorites i {
    font-size: 64px;
    color: #dee2e6;
    margin-bottom: 20px;
}

.giflix-no-favorites p {
    color: #6c757d;
    font-size: 18px;
    margin-bottom: 20px;
}

/* =========== ФАЙЛЫ =========== */

/* Таблица файлов */
.files-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.files-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #e9ecef;
}

.files-table td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.files-table tr:last-child td {
    border-bottom: none;
}

.files-table tr:hover {
    background: #f8f9fa;
}

.file-actions {
    display: flex;
    gap: 5px;
    justify-content: flex-start;
}

.file-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.file-link:hover {
    text-decoration: underline;
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.draft {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-badge.file,
.status-badge.published {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.loading-cell,
.error-cell {
    text-align: center;
    padding: 30px !important;
}

.error-cell {
    color: #e74c3c;
}

/* Загрузка файлов */
.upload-section {
    /* background: #232136; */
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 2px dashed #3498db;
}

.upload-form {
    max-width: 500px;
    margin: 0 auto;
}

.upload-info {
    /* background: #232136; */
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #3498db;
}

.upload-info ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.upload-info li {
    margin-bottom: 5px;
    color: #666;
}

.upload-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.upload-warning i {
    color: #f39c12;
    margin-right: 8px;
}

/* Область загрузки */
.file-upload-area {
    position: relative;
    cursor: pointer;
    margin-bottom: 20px;
}

.file-upload-wrapper {
    border: 2px dashed #3498db;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s;
    background: #f8fdff;
}

.file-upload-area:hover .file-upload-wrapper {
    border-color: #2980b9;
    background: #f0f9ff;
}

.file-upload-area.dragover .file-upload-wrapper {
    border-color: #2ecc71;
    background: #f0fdf4;
}

.file-upload-wrapper i {
    font-size: 48px;
    color: #3498db;
    margin-bottom: 15px;
}

.file-upload-wrapper p {
    margin-bottom: 10px;
    color: #999;
    font-weight: 500;
}

.file-upload-wrapper small {
    color: #999;
    font-size: 12px;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

#selectedFileName {
    color: #3498db;
    font-weight: 500;
    margin-top: 10px;
}

#cancelUpload {
    margin-left: 10px;
}

/* Прогресс-бар */
.upload-progress {
    margin-top: 20px;
}

.progress-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 12px;
    color: #666;
    text-align: center;
}

/* Анимированные GIF */
.animated-gif {
    animation-play-state: running !important;
}

.files-grid-item .file-thumbnail img {
    /* max-width: 100%;
    height: auto; */
    display: block;
    object-fit: cover;
}

.files-grid-item.new-file {
    animation: highlightPulse 2s ease-in-out;
    box-shadow: 0 0 0 2px #3498db;
}

@keyframes highlightPulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(52, 152, 219, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0); }
}

/* =========== АДАПТИВНОСТЬ =========== */
@media (max-width: 1024px) {
    .account-tabs {
        flex-direction: column;
    }
    
    .tab-navigation {
        width: 100%;
        display: flex;
        overflow-x: auto;
        padding: 0;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
    
    .tab-link {
        flex-direction: column;
        flex: 1;
        min-width: 170px;
        border-left: 1px solid #d3d3d3;
        border-right: 1px solid #d3d3d3;
        border-bottom: 3px solid transparent;
        padding: 15px 5px;
        justify-content: center;
    }
    
    .tab-link.active {
        border-left-color: transparent;
        border-bottom-color: #3498db;
    }
    
    .tab-content {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .account-header {
        padding: 10px;
    }

    .giflix-account-buttons {
        margin-left: 0;
        flex-direction: column;
        gap: 5px;
        align-items: flex-end;
    }
    
    .giflix-user-menu {
        align-items: flex-start;
        gap: 10px;
        width: 100%;
        flex-wrap: nowrap;
    }
    
    .giflix-auth-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-login,
    .btn-register {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
        max-width: 350px;
    }
    
    .files-table {
        display: block;
        overflow-x: auto;
        font-size: 12px;
    }
    
    .files-table th,
    .files-table td {
        padding: 10px;
    }
    
    .giflix-favorites-grid,
    .giflix-grid-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .giflix-favorite-item {
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .giflix-account-buttons {
        align-items: stretch;
    }
    
    .user-greeting {
        display: none;
    }
    
    .modal-content {
        padding: 15px;
        max-width: 320px;
    }
    
    .modal-content h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-submit,
    .btn-secondary,
    .giflix-switch-to-register,
    .giflix-switch-to-login {
        width: 100%;
    }
}


/* Мои файлы */
/* .files-grid-item {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
} */

.files-grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.file-thumbnail {
    width: 100%;
    height: 180px;
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
}

.file-thumbnail img,
.file-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.draft-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 20px;
    text-align: center;
}

.draft-overlay i {
    font-size: 32px;
    margin-bottom: 10px;
}

.draft-overlay span {
    font-size: 14px;
    font-weight: bold;
}

.published-link {
    display: block;
    width: 100%;
    height: 100%;
}

.published-link:hover {
    opacity: 0.9;
}

.file-content {
    padding: 15px;
}

.file-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    word-break: break-word;
    color: #c3c4c7;
}

.file-meta {
    margin-bottom: 10px;
}

.file-meta-item {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.file-meta-item i {
    width: 16px;
    color: #999;
}

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 5px;
}

.status-draft {
    background: #f39c12;
    color: white;
}

.file-meta .status-publish {
    background: #2ecc71;
    color: white;
}

.status-file {
    background: #3498db;
    color: white;
}

.file-actions {
    display: flex;
    gap: 5px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.file-action-btn {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-download {
    background: #3498db;
    color: white;
}

.btn-download:hover {
    background: #2980b9;
}

.btn-view {
    background: #2ecc71;
    color: white;
}

.btn-view:hover {
    background: #27ae60;
}

.btn-edit {
    background: #f39c12;
    color: white;
}

.btn-edit:hover {
    background: #d68910;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

.btn-delete:hover {
    background: #c0392b;
}

.file-icon {
    font-size: 48px;
    color: #ddd;
    text-align: center;
    padding: 20px 0;
}

.files-title, .favorites-title, .download-title {
    margin-bottom: 20px;
}


.file-upload-wrapper {
    /* background: #232136 !important; */
}