/* Admin Panel Styles */

body {
    overflow-y: auto;
    overflow-x: hidden;
}

/* Header */
.admin-header {
    background: #11111b;
    border-bottom: 2px solid #313244;
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 15px 0;
}

.admin-header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: bold;
    color: #f38ba8;
}

.admin-logo i {
    font-size: 28px;
}

.admin-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    color: #cdd6f4;
    text-decoration: none;
    transition: all 0.3s;
    background: rgba(88, 91, 112, 0.1);
}

.admin-nav-link:hover {
    background: rgba(88, 91, 112, 0.3);
    color: #74c7ec;
}

/* Main Layout */
.admin-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
}

/* Sidebar */
.admin-sidebar {
    position: sticky;
    top: 90px;
    height: fit-content;
}

.sidebar-section {
    background: linear-gradient(135deg, #1e1e2e 0%, #181825 100%);
    border: 1px solid rgba(116, 199, 236, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.sidebar-section h3 {
    color: #74c7ec;
    font-size: 16px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(88, 91, 112, 0.2);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: #cdd6f4;
    font-size: 14px;
}

.stat-value {
    color: #a6e3a1;
    font-size: 18px;
    font-weight: bold;
}

/* Content Area */
.admin-content {
    background: linear-gradient(135deg, #1e1e2e 0%, #181825 100%);
    border: 1px solid rgba(116, 199, 236, 0.2);
    border-radius: 12px;
    padding: 30px;
}

/* Toolbar */
.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #313244;
}

.admin-toolbar h1 {
    color: #cdd6f4;
    font-size: 28px;
    margin: 0;
}

.toolbar-actions {
    display: flex;
    gap: 10px;
}

/* Filters */
.admin-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(88, 91, 112, 0.1);
    border-radius: 8px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.filter-group label {
    color: #cdd6f4;
    font-size: 14px;
    font-weight: 500;
}

.filter-group select,
.filter-group input[type="text"] {
    padding: 10px 12px;
    background: rgba(88, 91, 112, 0.2);
    border: 1px solid rgba(116, 199, 236, 0.3);
    border-radius: 6px;
    color: #cdd6f4;
    font-size: 14px;
}

.filter-group select:focus,
.filter-group input[type="text"]:focus {
    outline: none;
    border-color: #74c7ec;
}

/* Templates Table */
.templates-table-container {
    overflow-x: auto;
}

.templates-table {
    width: 100%;
    border-collapse: collapse;
}

.templates-table thead {
    background: rgba(88, 91, 112, 0.2);
}

.templates-table th {
    padding: 12px;
    text-align: left;
    color: #74c7ec;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 2px solid #313244;
}

.templates-table td {
    padding: 12px;
    color: #cdd6f4;
    border-bottom: 1px solid rgba(88, 91, 112, 0.2);
}

.templates-table tbody tr:hover {
    background: rgba(88, 91, 112, 0.1);
}

.template-thumb {
    width: 50px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(116, 199, 236, 0.2);
}

.template-id {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #6c7086;
    display: block;
    margin-top: 4px;
}

.price-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.price-free {
    background: rgba(166, 227, 161, 0.2);
    color: #a6e3a1;
}

.price-paid {
    background: rgba(137, 220, 235, 0.2);
    color: #89dceb;
}

.table-actions {
    display: flex;
    gap: 5px;
}

.action-btn {
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.action-btn-edit {
    background: rgba(137, 220, 235, 0.2);
    color: #89dceb;
}

.action-btn-edit:hover {
    background: rgba(137, 220, 235, 0.3);
}

.action-btn-delete {
    background: rgba(243, 139, 168, 0.2);
    color: #f38ba8;
}

.action-btn-delete:hover {
    background: rgba(243, 139, 168, 0.3);
}

.action-btn-copy {
    background: rgba(166, 227, 161, 0.2);
    color: #a6e3a1;
}

.action-btn-copy:hover {
    background: rgba(166, 227, 161, 0.3);
}

.table-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6c7086;
}

.table-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}

.modal-content {
    background: linear-gradient(135deg, #1e1e2e 0%, #181825 100%);
    border: 1px solid rgba(116, 199, 236, 0.3);
    border-radius: 16px;
    padding: 30px;
    position: relative;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 900px;
}

.modal-content h2 {
    color: #cdd6f4;
    font-size: 24px;
    margin-bottom: 25px;
}

/* Form */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    color: #cdd6f4;
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: rgba(88, 91, 112, 0.2);
    border: 1px solid rgba(116, 199, 236, 0.3);
    border-radius: 6px;
    color: #cdd6f4;
    font-size: 14px;
    font-family: inherit;
}

/* Dark dropdown list for select options (where supported) */
.filter-group select option,
.form-group select option {
    background-color: #1e1e2e;
    color: #cdd6f4;
}

/* Improve select appearance to match dark theme */
.filter-group select,
.form-group select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Custom arrow for selects (optional) */
.filter-group select,
.form-group select {
    background-image: linear-gradient(135deg, rgba(88,91,112,0.25), rgba(88,91,112,0.1));
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.form-group textarea {
    resize: vertical;
    font-family: 'Courier New', monospace;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #74c7ec;
}

.form-group small {
    display: block;
    color: #6c7086;
    font-size: 12px;
    margin-top: 5px;
}

.form-group input[type="file"] {
    margin-top: 8px;
    color: #cdd6f4;
}

.form-actions-inline {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #313244;
}

/* Buttons */
.button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    text-decoration: none;
}

.button-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.button-primary:hover {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.button-secondary {
    background: rgba(88, 91, 112, 0.3);
    color: #cdd6f4;
}

.button-secondary:hover {
    background: rgba(88, 91, 112, 0.5);
}

.button-success {
    background: linear-gradient(135deg, #a6e3a1 0%, #94e2d5 100%);
    color: #181825;
}

.button-success:hover {
    box-shadow: 0 4px 15px rgba(166, 227, 161, 0.4);
}

.button-danger {
    background: linear-gradient(135deg, #f38ba8 0%, #eba0ac 100%);
    color: white;
}

.button-danger:hover {
    box-shadow: 0 4px 15px rgba(243, 139, 168, 0.4);
}

/* Responsive */
@media (max-width: 1024px) {
    .admin-main {
        grid-template-columns: 1fr;
    }
    
    .admin-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .admin-header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .admin-filters {
        flex-direction: column;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .toolbar-actions {
        flex-wrap: wrap;
    }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 30px 0;
    padding: 20px;
}

.pagination-button {
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(88, 91, 112, 0.2);
    border: 1px solid rgba(116, 199, 236, 0.3);
    color: #cdd6f4;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination-button:hover:not(:disabled) {
    background: rgba(116, 199, 236, 0.2);
    border-color: #74c7ec;
}

.pagination-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    font-weight: bold;
}

.pagination-info {
    color: #6c7086;
    font-size: 14px;
}

/* Footer */
.admin-footer {
    background: #11111b;
    border-top: 1px solid #313244;
    padding: 30px 20px;
    margin-top: 60px;
}

.admin-footer-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
    color: #6c7086;
}

.admin-footer-content p {
    margin: 5px 0;
    font-size: 14px;
}

.admin-footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.admin-footer-links a {
    color: #74c7ec;
    text-decoration: none;
    transition: color 0.3s;
}

.admin-footer-links a:hover {
    color: #89dceb;
}
