/* AdminNews Specific Styles */

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

/* Admin Navigation */
.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.admin-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.admin-nav-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #212529;
    text-decoration: none;
}

.admin-nav-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.admin-nav-btn.active:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.admin-nav-btn svg {
    fill: currentColor;
    flex-shrink: 0;
}

/* Section Headers */
.section-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 1rem;
}

.section-header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
    color: #212529;
}

.section-header p {
    margin: 0;
    color: #6c757d;
    font-size: 1rem;
}

/* News List Styles */
.news-list {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
}

.news-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.news-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #adb5bd;
}

.news-item.featured {
    border-color: #ffc107;
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}

.news-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.news-item-title-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.news-item-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.featured-badge {
    background: #ffc107;
    color: #212529;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.news-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.news-item-content {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 1rem;
    max-height: 3.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.news-item-images {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.news-item-image {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.2s ease;
}

.btn-view {
    background: #17a2b8;
    color: white;
    border-color: #17a2b8;
}

.btn-view:hover {
    background: #138496;
    border-color: #117a8b;
    color: white;
    text-decoration: none;
}

.btn-edit {
    background: #ffc107;
    color: #212529;
    border-color: #ffc107;
}

.btn-edit:hover {
    background: #e0a800;
    border-color: #d39e00;
    color: #212529;
    text-decoration: none;
}

.btn-delete {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.btn-delete:hover {
    background: #c82333;
    border-color: #bd2130;
    color: white;
    text-decoration: none;
}

.btn-small svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.btn-primary.btn-small {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.btn-primary.btn-small:hover {
    background: #0056b3;
    border-color: #004085;
}

.btn-secondary.btn-small {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.btn-secondary.btn-small:hover {
    background: #545b62;
    border-color: #4e555b;
}

/* Loading and Empty States */
.loading-message {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
    font-style: italic;
}

.no-news-message {
    text-align: center;
    padding: 3rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.no-news-message h3 {
    color: #495057;
    margin-bottom: 0.5rem;
}

.no-news-message p {
    color: #6c757d;
    margin: 0;
}

/* Form Styles */
.admin-form {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    margin-top: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6c757d;
}

/* Checkbox Styles */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.checkbox-label .checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #ced4da;
    border-radius: 3px;
    background: white;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #007bff;
    border-color: #007bff;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Image Preview Styles */
.image-preview-container {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.image-preview-container.hidden {
    display: none;
}

.image-preview-container h4 {
    margin: 0 0 1rem 0;
    color: #495057;
    font-size: 1rem;
}

.image-preview {
    display: flex;
    gap: 1rem;
}

.image-preview-item {
    position: relative;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
    background: white;
    flex: 1;
    max-width: 200px;
}

.image-preview-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.image-preview-info {
    padding: 0.5rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.image-preview-name {
    margin: 0 0 0.25rem 0;
    font-weight: 500;
    color: #495057;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-preview-size {
    margin: 0;
}

.image-preview-remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    transition: background-color 0.2s ease;
}

.image-preview-remove:hover {
    background: #dc3545;
}

/* Upload Progress */
.upload-progress {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.upload-progress.hidden {
    display: none;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: #007bff;
    transition: width 0.3s ease;
    border-radius: 10px;
    width: 0%;
}

.progress-text {
    font-size: 0.875rem;
    color: #495057;
    text-align: center;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #dee2e6;
}

.btn-primary {
    background: #007bff;
    color: white;
    border: 1px solid #007bff;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #0056b3;
    border-color: #004085;
    color: white;
    text-decoration: none;
}

.btn-primary:disabled {
    background: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: 1px solid #6c757d;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #545b62;
    border-color: #4e555b;
    color: white;
    text-decoration: none;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: 1px solid #dc3545;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: #c82333;
    border-color: #bd2130;
    color: white;
    text-decoration: none;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal.visible .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

.modal-header h3 {
    margin: 0;
    color: #495057;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #495057;
}

.modal-body {
    padding: 1.5rem;
    min-width: 500px;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid #dee2e6;
    justify-content: flex-end;
}

.confirmation-modal .modal-content {
    max-width: 400px;
}

.confirmation-modal .modal-body {
    min-width: auto;
}

/* Modal Content Styles */
.modal-news-images {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
}

.modal-news-image {
    width: 100%;
    max-width: 300px;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.modal-news-content {
    line-height: 1.6;
    color: #495057;
    margin: 1rem 0;
    white-space: pre-wrap;
}

.modal-news-url {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.modal-news-url strong {
    color: #495057;
    font-weight: 600;
}

.modal-news-url a {
    color: #007bff;
    text-decoration: none;
    word-break: break-all;
}

.modal-news-url a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.modal-news-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 1rem;
    align-items: center;
}

.modal-news-meta .featured-badge {
    background: #ffc107;
    color: #212529;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Message Container */
.message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
    max-width: 400px;
}

.message {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInRight 0.3s ease;
}

.message.success {
    border-color: #28a745;
    background: #d4edda;
    color: #155724;
}

.message.error {
    border-color: #dc3545;
    background: #f8d7da;
    color: #721c24;
}

.message.warning {
    border-color: #ffc107;
    background: #fff3cd;
    color: #856404;
}

.message.info {
    border-color: #17a2b8;
    background: #d1ecf1;
    color: #0c5460;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .admin-page-container {
        flex-direction: column;
        margin: 1rem;
        gap: 1rem;
    }
    
    .admin-sidebar {
        flex: none;
        position: static;
        margin-bottom: 1rem;
    }
    
    .admin-nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 1rem;
        margin-top: 1rem;
    }
    
    .admin-nav-btn {
        white-space: nowrap;
        min-width: 160px;
    }
    
    .admin-content {
        padding: 1.5rem;
    }
    
    .news-item-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .news-item-title-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .news-item-actions {
        justify-content: flex-start;
    }
    
    .modal-body {
        min-width: auto;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .image-preview {
        flex-direction: column;
    }
    
    .image-preview-item {
        max-width: none;
    }
    
    .message-container {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .admin-page-container {
        margin: 0.5rem;
    }
    
    .admin-sidebar {
        padding: 1rem;
    }
    
    .admin-form {
        padding: 1rem;
    }
    
    .modal-content {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
    
    .image-preview-img {
        height: 80px;
    }
    
    .news-item-image {
        width: 100px;
        height: 60px;
    }
} 