/* Dashboard CSS - Premium Look */
:root {
    --primary: #6366f1;
    /* Indigo 500 */
    --primary-hover: #4f46e5;
    --sidebar-bg: #1e1e2d;
    /* Dark Sidebar */
    --sidebar-text: #a6a7b9;
    --bg-main: #f3f6f9;
    --white: #ffffff;
    --border: #e1e1e1;
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: #333;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 24px;
    flex-shrink: 0;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    color: white;
    margin-bottom: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.5px;
}

.logo i {
    color: var(--primary);
}

.nav-section h3 {
    font-size: 11px;
    font-weight: 700;
    color: #565674;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.add-cat-btn {
    background: #36364b;
    border: none;
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.add-cat-btn:hover {
    background: var(--primary);
}

.sidebar ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

.sidebar li {
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.sidebar li:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.sidebar li.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    height: 80px;
    background: var(--white);
    border-bottom: 1px solid #ebf0f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.search-box {
    position: relative;
    width: 400px;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.search-box input {
    width: 60%;
    /* Adjusted for padding */
    width: 100%;
    padding: 12px 16px 12px 42px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    background: #f9fafb;
    outline: none;
    transition: all 0.2s;
}

.search-box input:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn {
    padding: 12px 24px;
    /* Bigger buttons */
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 6px 10px rgba(79, 70, 229, 0.3);
    transform: translateY(-1px);
}

/* Grid */
.content-area {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

h1 {
    font-size: 28px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 30px;
    letter-spacing: -0.5px;
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background: white;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-card);
    position: relative;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.card-preview {
    height: 180px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 60px;
    border-bottom: 1px solid #f1f5f9;
}

.card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
}

.card-meta {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 20px;
    flex: 1;
}

.card-actions {
    display: flex;
    gap: 10px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.card:hover .card-actions {
    opacity: 1;
}

.card-actions .btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    flex: 1;
    justify-content: center;
}

.btn-secondary {
    background: white;
    border: 1px solid #e2e8f0;
    color: #475569;
}

.btn-secondary:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.btn-danger {
    background: #fee2e2;
    color: #ef4444;
    border: 1px solid #fecaca;
    flex: 0;
    padding: 8px 12px;
}

.btn-danger:hover {
    background: #fecaca;
}

/* Specific Use Template Button */
.btn-use-template {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    /* Emerald Green */
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.25);
    opacity: 1 !important;
    /* Always visible */
    border: none;
    padding: 10px 20px;
}

.btn-use-template:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(16, 185, 129, 0.35);
    background: linear-gradient(135deg, #34d399 0%, #059669 100%);
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal {
    background: white;
    border-radius: 16px;
    width: 450px;
    max-width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
}

.close-btn:hover {
    color: #64748b;
}

.modal-body {
    padding: 24px;
}

.modal-body label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
    margin-top: 16px;
}

.modal-body label:first-child {
    margin-top: 0;
}

.modal-body input,
.modal-body select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: all 0.2s;
}

.modal-body input:focus,
.modal-body select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.modal-footer {
    padding: 20px 24px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Gallery Tabs */
.gallery-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    background: #e2e8f0;
    padding: 5px;
    border-radius: 12px;
    width: fit-content;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: #334155;
    background: rgba(255, 255, 255, 0.5);
}

.tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}