:root {
    --primary: #059669;
    --primary-light: #ecfdf5;
    --primary-border: #10b98133;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-hover: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
}

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

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 20px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.dashboard-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.dashboard-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--primary-light);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-container {
    width: 48px;
    height: 48px;
    background-color: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-container img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.header-title h1 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
}

.header-title p {
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
}

/* Search */
.search-container {
    position: relative;
    width: 300px;
}

.search-container i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
}

.search-container input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background-color: var(--bg-card);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.search-container input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Grid Layout */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

/* Category Card */
.category-card {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    height: fit-content;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.category-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fcfdfd;
}

.category-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-info i {
    font-size: 20px;
    color: #f59e0b; /* Default icon color from image */
}

.category-info h2 {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text-main);
}

.category-count {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    background-color: var(--primary-light);
    color: var(--primary);
    border-radius: 10px;
    text-transform: lowercase;
}

/* Link Item */
.link-list {
    padding: 5px 0;
}

.link-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s;
}

.link-item:last-child {
    border-bottom: none;
}

.link-item:hover {
    background-color: #f8fafc;
}

.link-main {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.link-index {
    width: 24px;
    height: 24px;
    background-color: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

.link-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
}

.link-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s;
    font-size: 18px;
    background: none;
    border: none;
    display: flex;
    align-items: center;
}

.action-btn:hover {
    color: var(--primary);
}

.action-btn.edit-btn:hover {
    color: #f59e0b;
}

.action-btn.delete-btn:hover {
    color: #ef4444;
}

/* Empty State & Loading */
.loading-state, .empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 100px 0;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: spin 1s linear infinite;
}

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

/* Footer */
.footer {
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-muted);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1e293b;
    color: white;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    z-index: 1000;
    transition: opacity 0.3s, transform 0.3s;
}

.toast.hidden {
    opacity: 0;
    transform: translate(-50%, 20px);
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-container {
        width: 100%;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* Modal Styling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background-color: var(--bg-card);
    width: 90%;
    max-width: 500px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    transform: translateY(0);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal.hidden .modal-content {
    transform: translateY(20px);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #ef4444;
}

.modal-body {
    padding: 25px;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background-color: var(--bg-body);
    transition: border-color 0.2s;
    outline: none;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--primary);
    background-color: var(--bg-card);
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-btn:hover {
    background-color: #047857;
}

.submit-btn:disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background-color: #f8fafc;
}

.tab-btn {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn:hover {
    background-color: #f1f5f9;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background-color: white;
}

.divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 20px 0;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.update-btn {
    background-color: #f59e0b;
}

.update-btn:hover {
    background-color: #d97706;
}

.delete-btn-modal {
    background-color: #ef4444;
}

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

.d-none {
    display: none !important;
}

