﻿
/* ---------- RESET & BASE ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f4f7f6;
    color: #333;
    height: 100vh;
    display: flex;
    overflow: hidden;
}

/* ---------- SIDEBAR (fixed left) ---------- */
.sidebar {
    width: 250px;
    background-color: #1a237e;
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    height: 100vh;
    flex-shrink: 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    transition: width 0.3s ease;
}

.sidebar-header {
    padding: 0 20px 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

    .sidebar-header h2 {
        font-size: 18px;
        display: flex;
        align-items: center;
        gap: 10px;
    }

        .sidebar-header h2 i {
            color: #ffc107;
        }

.nav-menu {
    list-style: none;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.nav-item {
    width: 100%;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    color: #cfd8dc;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    border-left: 4px solid transparent;
}

    .nav-link i {
        width: 20px;
        text-align: center;
        font-size: 18px;
    }

    .nav-link:hover,
    .nav-link.active {
        background-color: rgba(255, 255, 255, 0.1);
        color: #fff;
        border-left-color: #ffc107;
    }

    .nav-link.logout {
        margin-top: auto;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

        .nav-link.logout:hover {
            color: #ff5252;
            border-left-color: #ff5252;
        }

/* ---------- MAIN CONTENT (scrollable) ---------- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    padding: 30px;
}

/* ---------- ACTION BAR ---------- */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-wrapper {
    position: relative;
    flex: 1;
    min-width: 250px;
    max-width: 500px;
}

    .search-wrapper input {
        width: 100%;
        padding: 10px 15px;
        padding-right: 40px;
        border-radius: 25px;
        border: 1px solid #e0e0e0;
        background-color: #f9f9f9;
        font-size: 15px;
        outline: none;
        transition: all 0.3s ease;
    }

        .search-wrapper input:focus {
            border-color: #1a237e;
            background-color: #fff;
            box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
        }

    .search-wrapper i {
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        color: #888;
    }

.btn-add-scheme {
    background-color: #1a237e;
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
    text-decoration: none;
    white-space: nowrap;
}

    .btn-add-scheme:hover {
        background-color: #0d1452;
    }

/* ---------- SCHEME GRID (4 cols) ---------- */
.schemes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

/* ---------- INDIVIDUAL SCHEME CARD WITH THEMED IMAGE ---------- */
.scheme-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid #eaeef2;
    display: flex;
    flex-direction: column;
}

    .scheme-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    }

/* ---- THEMED DUMMY IMAGE using picsum.photos with relevant seed ---- */
.scheme-image {
    width: 100%;
    height: 170px;
    background-color: #dce3ed;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

    .scheme-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    /* fallback icon if image fails */
    .scheme-image .fallback-icon {
        position: absolute;
        font-size: 52px;
        color: #3f4a5e;
        opacity: 0.6;
        pointer-events: none;
    }

/* card body */
.card-body-wrap {
    padding: 16px 18px 18px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a237e;
    margin-bottom: 6px;
    line-height: 1.3;
}

.card-desc {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    margin-bottom: 14px;
    flex: 1;
}

.card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #edf0f5;
    margin-top: auto;
}

.action-btn {
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-edit {
    background-color: #e3f2fd;
    color: #1565c0;
}

    .btn-edit:hover {
        background-color: #1565c0;
        color: #fff;
    }

.btn-delete {
    background-color: #ffebee;
    color: #c62828;
}

    .btn-delete:hover {
        background-color: #c62828;
        color: #fff;
    }

/* ---------- MODAL (overlay) ---------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

    .modal-overlay.active {
        display: flex;
    }

.modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 550px;
    width: 90%;
    padding: 30px 35px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 12px;
}

    .modal-header h3 {
        font-size: 20px;
        color: #1a237e;
    }

.close-modal-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #888;
    transition: color 0.2s;
}

    .close-modal-btn:hover {
        color: #c62828;
    }

.form-group {
    margin-bottom: 18px;
}

    .form-group label {
        display: block;
        font-weight: 600;
        margin-bottom: 5px;
        color: #444;
        font-size: 14px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid #ccc;
        border-radius: 6px;
        font-size: 14px;
        outline: none;
        transition: border 0.3s;
    }

        .form-group input:focus,
        .form-group select:focus,
        .form-group textarea:focus {
            border-color: #1a237e;
        }

    .form-group textarea {
        resize: vertical;
        min-height: 80px;
    }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
}

.btn-cancel-modal {
    background: #e0e0e0;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

    .btn-cancel-modal:hover {
        background: #bdbdbd;
    }

.btn-save-modal {
    background: #1a237e;
    color: #fff;
    border: none;
    padding: 10px 28px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

    .btn-save-modal:hover {
        background: #0d1452;
    }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1200px) {
    .schemes-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .schemes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
        overflow-y: auto;
        height: auto;
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding: 10px 0;
    }

    .nav-menu {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-link {
        padding: 10px 15px;
        border-left: none;
        border-bottom: 2px solid transparent;
    }

        .nav-link:hover,
        .nav-link.active {
            border-left-color: transparent;
            border-bottom-color: #ffc107;
        }

        .nav-link.logout {
            margin-top: 0;
            border-top: none;
        }

    .main-content {
        height: auto;
        padding: 20px;
    }
}

@media (max-width: 600px) {
    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-wrapper {
        max-width: 100%;
    }

    .schemes-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        padding: 20px;
    }

    .scheme-image {
        height: 140px;
    }
}


