/* ============================================
   ADMIN PANEL STYLESHEET
   ============================================ */

:root {
    --primary-color: #6c63ff;
    --secondary-color: #4facfe;
    --accent-color: #00f2fe;
    --dark-color: #1a1a2e;
    --darker-color: #16213e;
    --sidebar-bg: #1e1e2d;
    --card-bg: #ffffff;
    --light-color: #f4f6f9;
    --text-color: #333;
    --text-light: #666;
    --text-muted: #999;
    --white: #ffffff;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --gradient-1: linear-gradient(135deg, #6c63ff 0%, #4facfe 100%);
    --gradient-2: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 10px 40px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--light-color);
    color: var(--text-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-2);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-box {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow-hover);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header i {
    font-size: 4rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
}

.login-header h1 {
    font-size: 1.8rem;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.login-header p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: #fee;
    color: var(--danger);
    border: 1px solid #fcc;
}

.alert-success {
    background: #efe;
    color: var(--success);
    border: 1px solid #cfc;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-color);
}

.login-form label i {
    color: var(--primary-color);
}

.login-form input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--gradient-1);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(108, 99, 255, 0.4);
}

.login-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.login-footer a {
    color: var(--primary-color);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.login-footer a:hover {
    color: var(--secondary-color);
}

/* ============================================
   ADMIN DASHBOARD LAYOUT
   ============================================ */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--white);
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 25px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header i {
    font-size: 1.8rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 5px;
    transition: var(--transition);
    font-weight: 500;
    cursor: pointer;
    border: 2px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.nav-item.active {
    background: var(--gradient-2) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateX(5px);
}

.nav-item i {
    font-size: 1.1rem;
    width: 20px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-view-site,
.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 10px;
}

.btn-view-site {
    background: var(--gradient-1);
    color: var(--white);
}

.btn-view-site:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 99, 255, 0.4);
}

.btn-logout {
    background: rgba(220, 53, 69, 0.2);
    color: var(--danger);
    margin-bottom: 0;
}

.btn-logout:hover {
    background: var(--danger);
    color: var(--white);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.admin-header h1 {
    font-size: 1.8rem;
    color: var(--dark-color);
}

.mobile-menu-btn {
    display: none;
}

.sidebar-close {
    display: none;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-light);
}

.admin-user i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Settings Sections */
.settings-section {
    display: none !important;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.settings-section.active {
    display: block !important;
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-header h2 {
    font-size: 1.4rem;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2 i {
    color: var(--primary-color);
}

/* Forms */
.settings-form {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-row.three-col {
    grid-template-columns: repeat(3, 1fr);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--white);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* File Upload */
.file-upload {
    position: relative;
}

.file-upload input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    background: #f9f9f9;
    cursor: pointer;
    transition: var(--transition);
}

.file-label:hover {
    border-color: var(--primary-color);
    background: rgba(108, 99, 255, 0.05);
}

.file-label i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.current-file {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.current-file i {
    color: var(--danger);
    font-size: 1.5rem;
}

.preview-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-save {
    background: var(--gradient-1);
    color: var(--white);
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(108, 99, 255, 0.4);
}

.btn-add {
    background: var(--success);
    color: var(--white);
}

.btn-add:hover {
    background: #218838;
}

.btn-cancel {
    background: #e0e0e0;
    color: var(--text-color);
}

.btn-cancel:hover {
    background: #ccc;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

/* Add Forms */
.add-form {
    background: var(--white);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    border-left: 4px solid var(--success);
}

/* Items List */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.item-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.item-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-hover);
}

.item-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-icon i {
    font-size: 1.8rem;
    color: var(--white);
}

.item-info {
    flex: 1;
}

.item-info h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--dark-color);
}

.skill-bar {
    width: 200px;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.skill-fill {
    height: 100%;
    background: var(--gradient-1);
    border-radius: 4px;
}

.skill-percent {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-left: 10px;
}

.item-actions {
    display: flex;
    gap: 10px;
}

.btn-edit,
.btn-delete {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-edit {
    background: rgba(108, 99, 255, 0.1);
    color: var(--primary-color);
}

.btn-edit:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn-delete {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.btn-delete:hover {
    background: var(--danger);
    color: var(--white);
}

/* Items Grid */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.project-item,
.cert-item {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.project-item:hover,
.cert-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.project-thumb,
.cert-thumb {
    height: 180px;
    overflow: hidden;
}

.project-thumb img,
.cert-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image {
    width: 100%;
    height: 100%;
    background: var(--gradient-2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-image i {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.5);
}

.project-details,
.cert-details {
    padding: 20px;
}

.project-details h3,
.cert-details h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--dark-color);
}

.project-details p,
.cert-details p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.project-link-small {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 500;
}

.project-link-small:hover {
    color: var(--secondary-color);
}

.project-item .item-actions,
.cert-item .item-actions {
    padding: 0 20px 20px;
    justify-content: flex-end;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 30px;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h2 {
    margin-bottom: 25px;
    color: var(--dark-color);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--danger);
}

/* Toast Messages */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: var(--white);
    font-weight: 500;
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        width: 80px;
    }

    .sidebar-header h2,
    .nav-item span,
    .btn-view-site span,
    .btn-logout span {
        display: none;
    }

    .sidebar-header {
        justify-content: center;
    }

    .nav-item {
        justify-content: center;
        padding: 14px;
    }

    .btn-view-site,
    .btn-logout {
        padding: 12px;
    }

    .main-content {
        margin-left: 80px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-row.three-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -300px !important;
        width: 280px !important;
        height: 100vh !important;
        transition: all 0.3s ease !important;
        z-index: 1001 !important;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        display: flex !important;
        flex-direction: column !important;
        box-shadow: 5px 0 15px rgba(0,0,0,0.3) !important;
        color: white !important;
    }

    .sidebar.active {
        left: 0 !important;
        transform: translateX(0) !important;
    }

    /* Ensure all text is visible on mobile */
    .sidebar * {
        color: white !important;
    }

    .sidebar .nav-item {
        color: rgba(255, 255, 255, 0.9) !important;
    }

    .sidebar .nav-item.active {
        background: rgba(255, 255, 255, 0.2) !important;
        color: white !important;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .admin-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 15px;
    }

    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 50px;
        height: 50px;
        background: var(--gradient-1);
        border: none;
        border-radius: 12px;
        cursor: pointer;
        color: white;
        font-size: 1.4rem;
        box-shadow: 0 3px 15px rgba(108, 99, 255, 0.4);
        transition: var(--transition);
        position: relative;
        z-index: 1002;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .mobile-menu-btn:hover,
    .mobile-menu-btn:focus {
        transform: translateY(-2px);
        box-shadow: 0 5px 20px rgba(108, 99, 255, 0.5);
        outline: none;
    }

    .mobile-menu-btn:active {
        transform: translateY(0);
        background: var(--gradient-2);
    }

    .admin-header h1 {
        font-size: 1.3rem;
    }

    .items-grid {
        grid-template-columns: 1fr;
    }

    .item-card {
        flex-wrap: wrap;
    }

    .skill-bar {
        width: 100%;
    }

    .settings-form {
        padding: 20px;
    }

    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .section-header h2 {
        font-size: 1.2rem;
    }

    /* Show category names in sidebar on mobile */
    .sidebar-header h2,
    .nav-item span,
    .btn-view-site,
    .btn-logout {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .sidebar-header {
        justify-content: flex-start;
        position: relative;
        padding: 20px 15px;
    }

    .sidebar-close {
        display: flex;
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        width: 35px;
        height: 35px;
        background: rgba(255,255,255,0.1);
        border: none;
        border-radius: 8px;
        color: white;
        font-size: 1.2rem;
        cursor: pointer;
        align-items: center;
        justify-content: center;
    }

    .sidebar-close:hover {
        background: rgba(255,255,255,0.2);
    }

    .nav-item {
        justify-content: flex-start !important;
        padding: 16px 20px !important;
        display: flex !important;
        align-items: center !important;
        gap: 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .nav-item i {
        display: flex !important;
        width: 20px !important;
        font-size: 1.1rem !important;
    }

    .nav-item span {
        display: flex !important;
        font-size: 0.95rem !important;
        font-weight: 500 !important;
        color: rgba(255, 255, 255, 0.9) !important;
    }

    .sidebar-nav {
        padding: 15px 0 !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .sidebar-footer {
        padding: 15px !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 25px;
    }

    .login-header i {
        font-size: 3rem;
    }

    .login-header h1 {
        font-size: 1.5rem;
    }

    .admin-header h1 {
        font-size: 1.1rem;
    }

    .admin-user span {
        display: none;
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .form-group label {
        font-size: 0.9rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .item-card {
        padding: 15px;
    }

    .item-icon {
        width: 50px;
        height: 50px;
    }

    .item-icon i {
        font-size: 1.4rem;
    }

    .project-thumb,
    .cert-thumb {
        height: 150px;
    }

    .project-details,
    .cert-details {
        padding: 15px;
    }
}
