/* ===== CATEGORIES PAGE SPECIFIC STYLES ===== */

/* Admin page layout */
.admin-page {
    display: block !important;
}

.admin-page .container {
    display: block !important;
    flex-direction: column !important;
    max-width: 1000px !important;
    margin: 0 auto !important;
}

/* Admin header */
.admin-page .admin-header {
    display: flex !important;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    gap: 2rem;
    flex-wrap: wrap;
    width: 100% !important;
}

.header-content {
    flex: 1;
}

.admin-page .admin-header h2 {
    font-size: 2rem;
    margin: 0 0 0.3rem 0;
    color: #1f2937;
    font-weight: 700;
}

.admin-subtitle {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
}

.back-btn {
    padding: 0.6rem 1.2rem;
    background: #f0f0f0;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    display: inline-block;
    transition: all 0.2s ease;
    white-space: nowrap;
    align-self: flex-start;
}

.back-btn:hover {
    background: #e0e0e0;
}

/* Messages */
.success-message, .error-message {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

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

.success-message {
    background: #e8f5f0;
    color: #047857;
    border-left: 4px solid #047857;
}

.error-message {
    background: #fef2f2;
    color: #dc2626;
    border-left: 4px solid #dc2626;
}

/* Cards */
.cat-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.cat-card h3 {
    font-size: 1.3rem;
    margin: 0 0 1.5rem 0;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge {
    background: #20b090;
    color: white;
    border-radius: 20px;
    padding: 0.2rem 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: auto;
}

/* Form */
.cat-form {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem;
    width: 100% !important;
}

.cat-field {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem;
    width: 100% !important;
}

.cat-field label {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95rem;
}

.required {
    color: #dc2626;
}

.cat-field input {
    padding: 0.8rem 1rem !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    font-size: 0.95rem !important;
    font-family: inherit !important;
    background: white !important;
    color: #1f2937 !important;
    transition: all 0.2s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
}

.cat-field input:focus {
    outline: none !important;
    border-color: #20b090 !important;
    box-shadow: 0 0 0 3px rgba(32, 176, 144, 0.1) !important;
    background: #f9fdfb !important;
}

.cat-field small {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.2rem;
}

/* Actions */
.cat-actions {
    display: flex !important;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.save-btn, .delete-btn, .cancel-btn {
    padding: 0.8rem 1.5rem !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap;
}

.save-btn {
    background: #20b090 !important;
    color: white !important;
    flex: 1;
    min-width: 150px;
}

.save-btn:hover {
    background: #1a9878 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(32, 176, 144, 0.3);
}

.delete-btn {
    background: #dc2626 !important;
    color: white !important;
    flex: 1;
    min-width: 150px;
}

.delete-btn:hover {
    background: #b91c1c !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.3);
}

.cancel-btn {
    background: #e0e0e0 !important;
    color: #333 !important;
    flex: 1;
    min-width: 150px;
}

.cancel-btn:hover {
    background: #d0d0d0 !important;
    transform: translateY(-2px);
}

/* Table */
.table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.admin-table thead {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.admin-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    color: #4b5563;
}

.admin-table tbody tr {
    transition: all 0.2s ease;
}

.admin-table tbody tr:hover {
    background: #f9fafb;
}

.col-id {
    width: 50px;
    text-align: center;
    color: #999;
}

.col-name {
    width: 250px;
}

.col-slug code {
    background: #f0f0f0;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #666;
    font-family: monospace;
}

.col-count {
    text-align: center;
    width: 100px;
}

.photo-badge {
    background: #e0f2fe;
    color: #0369a1;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

.col-actions {
    width: 100px;
    text-align: center;
}

/* Action buttons */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
    border: 1px solid transparent;
}

.action-btn.edit {
    background: #20b090;
    color: white;
    border-color: #20b090;
}

.action-btn.edit:hover {
    background: #1a9b7a;
    transform: translateY(-1px);
}

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

.action-btn.delete:hover {
    background: #c41e3a;
    transform: scale(1.08);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
    font-size: 1.1rem;
}

/* Category form fields styling */
.cat-field {
    margin-bottom: 1.5rem;
}

.cat-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95rem;
}

.cat-field label .required {
    color: #dc2626;
}

.cat-field input[type="text"],
.cat-field textarea,
.cat-field input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    color: #1f2937;
    background: white;
    transition: all 0.2s ease;
}

.cat-field input[type="text"]:focus,
.cat-field textarea:focus,
.cat-field input[type="file"]:focus {
    outline: none;
    border-color: #20b090;
    box-shadow: 0 0 0 3px rgba(32, 176, 144, 0.1);
}

.cat-field textarea {
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

.cat-field small {
    display: block;
    margin-top: 0.4rem;
    color: #666;
    font-size: 0.85rem;
}

.cat-field input[type="file"] {
    padding: 0.6rem;
    cursor: pointer;
}

.cat-field input[type="file"]::file-selector-button {
    padding: 0.5rem 1rem;
    background: #20b090;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 1rem;
    transition: all 0.2s ease;
    font-weight: 600;
}

.cat-field input[type="file"]::file-selector-button:hover {
    background: #1a9878;
}

/* Current image preview */
.current-image {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
}

.current-image img {
    max-width: 200px;
    border-radius: 8px;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.current-image small {
    display: block;
    color: #666;
    font-size: 0.85rem;
}

/* Category preview styles */
.cat-preview-box {
    width: 120px;
    height: 120px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 10px;
}

.cat-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cat-preview-placeholder {
    width: 100%;
    height: 100%;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    text-align: center;
    word-break: break-word;
    background: #f0f0f0;
}

/* Categories grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.category-card h4 {
    margin: 0.5rem 0;
    font-size: 1rem;
}

.category-card p {
    margin: 0.5rem 0;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
    display: -webkit-box;
    overflow: hidden;
}

.cat-btns {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.category-card .action-btn {
    min-width: auto;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.category-card .action-btn.edit {
    min-width: 7.5rem;
}

.category-card .action-btn.delete {
    min-width: 9rem;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.action-btn.edit {
    background: #20b090;
    color: white;
    border-color: #20b090;
}

.action-btn.edit:hover {
    background: #1a9b7a;
    transform: translateY(-1px);
}

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

.action-btn.delete:hover {
    background: #c41e3a;
    transform: scale(1.08);
}
/* Mobile */
@media (max-width: 768px) {
    .admin-page .admin-header {
        flex-direction: column;
    }

    .cat-card {
        padding: 1.5rem;
    }

    .cat-card h3 {
        font-size: 1.1rem;
    }

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

    .save-btn, .delete-btn, .cancel-btn {
        width: 100%;
        min-width: unset;
    }

    .admin-table {
        font-size: 0.85rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.75rem 0.5rem;
    }

    .col-name {
        width: 150px;
    }

    .col-id,
    .col-count {
        width: 50px;
    }
}

@media (max-width: 480px) {
    .admin-page .admin-header h2 {
        font-size: 1.5rem;
    }

    .cat-card {
        padding: 1rem;
    }

    .admin-table {
        font-size: 0.75rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.5rem;
    }

    .col-slug code {
        font-size: 0.7rem;
    }

    .category-card .action-btn {
        padding: 0.45rem 0.8rem;
        font-size: 0.85rem;
    }

    .badge {
        font-size: 0.75rem;
    }
}
