/* admin-style.css - Soft Material Theme with Nunito Sans & Enhanced Sidebar */

@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;600;700;800&display=swap');

:root {
    --bg-color: #eef2f9;
    --text-primary: #334155;
    --text-secondary: #64748b;
    --accent-primary: #3b82f6;
    --accent-primary-hover: #2563eb;
    --accent-danger: #ef4444;
    --accent-danger-hover: #dc2626;
    --accent-success: #22c55e;
    --accent-success-hover: #16a34a;
    --font-family: 'Nunito Sans', sans-serif;
    --shadow-light: #ffffff;
    --shadow-dark: #d1d9e6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.admin-wrapper { display: flex; width: 100%; height: 100%; }

/* --- Sidebar --- */
.sidebar {
    width: 260px;
    background-color: var(--bg-color);
    border-right: 1px solid var(--shadow-dark);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
    flex-shrink: 0;
    box-shadow: 5px 0px 10px rgba(0,0,0,0.05);
}

.sidebar-header { padding: 0 1.5rem 1.5rem 1.5rem; border-bottom: 1px solid var(--shadow-dark); }
.sidebar-header h2 { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); }
.sidebar-header p { font-size: 0.875rem; color: var(--text-secondary); margin-top: 0.25rem; }

.sidebar-nav { flex-grow: 1; overflow-y: auto; padding: 1rem 0; }
.sidebar-nav ul { list-style: none; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.5rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
    position: relative;
}
.sidebar-nav a:hover {
    color: var(--accent-primary);
    background-color: rgba(59, 130, 246, 0.05);
}
.sidebar-nav a.active {
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
    background-color: #fff;
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
    border-radius: 0 10px 10px 0;
    margin-right: 10px;
}
.sidebar-nav a .nav-icon { font-size: 1.2rem; width: 24px; text-align: center; }

.sidebar-footer { padding: 1.5rem; border-top: 1px solid var(--shadow-dark); }
.sidebar-footer a {
    display: block;
    text-align: center;
    padding: 0.75rem;
    background-color: var(--bg-color);
    color: var(--accent-danger);
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
    transition: all 0.2s ease;
}
.sidebar-footer a:hover { box-shadow: inset 2px 2px 5px var(--shadow-dark), inset -3px -3px 7px var(--shadow-light); color: var(--accent-danger-hover); }

/* --- Main Content --- */
.main-content { flex-grow: 1; padding: 2.5rem; overflow-y: auto; height: 100vh; }
.main-header h1 { font-size: 2.25rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text-primary); }
.main-header p { color: var(--text-secondary); margin-top: 0.5rem; }

/* --- Soft UI Components --- */
.card {
    background: var(--bg-color);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
}

.card-header { padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--shadow-dark); }
.card-header h2 { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); }
.card-header p { color: var(--text-secondary); font-size: 0.875rem; margin-top: 0.25rem; }

.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-secondary); }

.form-control {
    border-radius: 10px;
    border: none;
    background: var(--bg-color);
    padding: 0.9rem 1rem;
    box-shadow: inset 2px 2px 5px var(--shadow-dark), inset -3px -3px 7px var(--shadow-light);
    color: var(--text-primary);
    font-family: var(--font-family);
    width: 100%;
    word-break: break-all; /* Ensure long text breaks within the input */
}

/* Potentially increase max-width for specific cards if needed, or make main-content wider */
.main-content .card {
    max-width: 800px; /* Example: Adjust as needed for wider forms */
    margin-left: auto;
    margin-right: auto;
}
.form-control:focus { outline: none; border: 1px solid var(--accent-primary); box-shadow: inset 1px 1px 3px var(--shadow-dark), inset -1px -1px 3px var(--shadow-light), 0 0 0 2px rgba(59, 130, 246, 0.3); }

textarea.form-control { min-height: 120px; resize: vertical; }

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    text-align: center;
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
}
.btn:hover { transform: translateY(-2px); box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light); }
.btn:active { transform: translateY(1px); box-shadow: inset 2px 2px 5px var(--shadow-dark), inset -3px -3px 7px var(--shadow-light); }

.btn-primary { background-color: var(--accent-primary); color: white; }
.btn-primary:hover { background-color: var(--accent-primary-hover); }
.btn-danger { background-color: var(--accent-danger); color: white; }
.btn-danger:hover { background-color: var(--accent-danger-hover); }
.btn-success { background-color: var(--accent-success); color: white; }
.btn-success:hover { background-color: var(--accent-success-hover); }
.btn-secondary { background: var(--bg-color); color: var(--text-secondary); }
.btn-secondary:hover { color: var(--text-primary); }

/* --- Specific List Styles --- */
.item-list { list-style: none; }
.item-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 15px;
    margin-bottom: 1rem;
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
}
.item-list .item-text { flex-grow: 1; margin-right: 1rem; color: var(--text-primary); }
.item-list .item-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.item-list .item-actions .btn { padding: 0.5rem 1rem; font-size: 0.875rem; }

/* --- Login Page --- */
.login-container { display: flex; justify-content: center; align-items: center; width: 100%; height: 100vh; }
.login-box {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    background: var(--bg-color);
    border-radius: 20px;
    box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
}
.login-header { text-align: center; margin-bottom: 2rem; }
.login-header h1 { font-size: 1.8rem; font-weight: 800; color: var(--text-primary); }
.login-header p { color: var(--text-secondary); margin-top: 0.25rem; }

.alert {
    padding: 1rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    font-weight: 600;
    border: none;
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
}
.alert-danger { background-color: #fee2e2; color: var(--accent-danger); }
.alert-success { background-color: #d1fae5; color: var(--accent-success); }

/* --- Slideshow Manager Specific Styles --- */
.upload-zone {
    border: 2px dashed var(--text-secondary);
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    background: var(--bg-color);
    margin-bottom: 30px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    box-shadow: inset 2px 2px 5px var(--shadow-dark), inset -3px -3px 7px var(--shadow-light);
}
.upload-zone:hover { border-color: var(--accent-primary); box-shadow: inset 1px 1px 3px var(--shadow-dark), inset -1px -1px 3px var(--shadow-light); }
.upload-zone .upload-icon { font-size: 4em; color: var(--text-secondary); margin-bottom: 20px; }
.upload-zone .upload-text { font-size: 1.2em; color: var(--text-primary); margin-bottom: 10px; }
.upload-zone .upload-subtext { color: var(--text-secondary); font-size: 0.9em; }

.slideshow-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}
.file-card {
    background: var(--bg-color);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
    transition: all 0.3s ease;
}
.file-card:hover { transform: translateY(-3px); box-shadow: 8px 8px 15px var(--shadow-dark), -8px -8px 15px var(--shadow-light); }
.file-card .img-container { position: relative; height: 140px; background-color: #e0e5ec; overflow: hidden; border-bottom: 1px solid var(--shadow-dark); }
.file-card .img-container img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.file-card:hover .img-container img { transform: scale(1.1); }
.file-card .info-container { padding: 1rem; background-color: var(--bg-color); }
.file-card .filename { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 0.25rem; color: var(--text-primary); }
.file-card .file-meta { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 1rem; }
.file-card .actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.file-card .actions .btn { flex-grow: 1; padding: 0.4rem 0.8rem; font-size: 0.8rem; border-radius: 8px; }
.file-card .rename-form { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.file-card .rename-input { flex-grow: 1; background-color: var(--bg-color); border: none; color: var(--text-primary); border-radius: 8px; padding: 0.4rem 0.8rem; box-shadow: inset 1px 1px 3px var(--shadow-dark), inset -1px -1px 3px var(--shadow-light); }
.file-card .rename-input:focus { outline: none; border: 1px solid var(--accent-primary); box-shadow: inset 1px 1px 3px var(--shadow-dark), inset -1px -1px 3px var(--shadow-light), 0 0 0 2px rgba(59, 130, 246, 0.3); }

/* Modals */
.modal { background-color: rgba(0,0,0,0.4); }
.modal-content { background-color: var(--bg-color); border-radius: 20px; box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light); }
.modal-header h3 { color: var(--text-primary); }
.modal-buttons button { box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light); }
.modal-buttons button:active { box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light); }
.btn-replace, .btn-auto-rename, .btn-keep-original, .btn-cancel { border-radius: 8px; font-weight: 600; }
.btn-replace { background-color: var(--accent-danger); color: white; }
.btn-auto-rename { background-color: var(--accent-primary); color: white; }
.btn-keep-original { background-color: var(--accent-success); color: white; }
.btn-cancel { background-color: var(--text-secondary); color: white; }

/* Responsive */
@media (max-width: 768px) {
    body {
        height: auto;
        overflow: auto; /* Allow body to scroll */
    }

    .admin-wrapper {
        display: block; /* Override flex and stack elements */
        height: auto;
    }

    .sidebar {
        width: 100%;
        height: auto; /* Allow height to be determined by content */
        position: static; /* Make it a normal block element */
        flex-direction: column; /* Revert to column for vertical stacking of nav and footer */
        border-bottom: 1px solid var(--shadow-dark);
        border-right: none;
    }

    .sidebar-nav {
        display: flex;
        flex-direction: row; /* Make nav items horizontal */
        overflow-x: auto;   /* Add horizontal scroll if items overflow */
        padding: 0 0.5rem;
        border-bottom: none;
        /* Add some scrollbar styling for better UX */
        scrollbar-width: thin;
        scrollbar-color: var(--accent-primary) var(--bg-color);
    }
    
    .sidebar-nav ul {
        display: flex; /* Ensure ul is also flex */
        flex-direction: row;
    }

    .sidebar-nav a {
        border-left: none;
        border-bottom: 4px solid transparent;
        padding: 1rem;
        flex-shrink: 0; /* Prevent links from shrinking */
    }

    .sidebar-nav a.active {
        border-left: none;
        border-bottom-color: var(--accent-primary);
        background: none;
        box-shadow: none;
        border-radius: 0;
        margin-right: 0;
    }

    .sidebar-header, .sidebar-footer {
        display: none; /* Hide header and footer on mobile for simplicity */
    }

    .main-content {
        height: auto; /* Let content define its own height */
        padding: 1.5rem 1rem; /* Adjust padding for smaller screens */
    }
}
