/**
 * OKEEI Suite - Index/Dashboard Styles
 * V1 Horizontal Row + 1E Bottom Border Slide hover
 * Version: 2.0
 */

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 100vh;
}

/* When dashboard is visible, body starts from top */
body.dashboard-active {
    justify-content: flex-start;
    padding: 0;
}

/* ========== BRANDING ========== */
h1.brand-title {
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-align: center;
    font-size: 2rem;
    font-family: "Unbounded", sans-serif;
    font-weight: 700;
    color: var(--text-primary);
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 0.95rem;
    text-align: center;
}

/* ========== LOGIN SECTION ========== */
#loginSection {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.login-container {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

[data-theme="light"] .login-container {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.login-icon {
    text-align: center;
    margin-bottom: 30px;
}

.login-icon i {
    font-size: 4rem;
    color: var(--accent-purple);
}

.input-wrapper {
    position: relative;
}

.input-wrapper > i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.input-wrapper input {
    padding-left: 45px;
    padding-right: 50px;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
}

.toggle-password:hover {
    color: var(--accent-purple);
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-purple-light) 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: "Unbounded", sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(98, 0, 234, 0.4);
}

.error-message {
    background-color: rgba(207, 102, 121, 0.1);
    border: 1px solid var(--error-color);
    color: var(--error-color);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.9rem;
}

/* ========== DASHBOARD SECTION ========== */
#dashboardSection {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

#dashboardSection .okeei-header {
    position: sticky;
    top: 0;
    z-index: 100;
}

#dashboardSection .dashboard-content {
    flex: 1;
    padding: 24px 20px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1.dashboard-title {
    font-size: 2rem;
    margin-bottom: 0;
}

.logout-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.logout-btn:hover {
    background: rgba(207, 102, 121, 0.1);
    border-color: var(--error-color);
    color: var(--error-color);
}

/* Logout inside navbar */
.okeei-header .logout-btn {
    position: static;
    margin: 0;
}

/* ========== CATEGORY LABELS ========== */
.cat-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    width: 100%;
    max-width: 960px;
}

.cat-label i {
    font-size: 0.85rem;
}

.cat-label:not(:first-child) {
    margin-top: 24px;
}

/* ========== TOOL CARDS GRID ========== */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 960px;
}

.project-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* 1E: Bottom border slide hover */
.project-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    right: 50%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-purple-light));
    transition: all 0.25s ease;
}

.project-card:hover::after {
    left: 0;
    right: 0;
}

.project-card:hover {
    border-color: var(--border-color);
    background-color: var(--bg-hover);
    transform: translateY(-2px);
}

/* Icon box */
.project-card .card-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: all 0.2s;
}

/* Fallback for old cards without .card-icon */
.project-card > i {
    font-size: 1.2rem;
    color: var(--accent-purple-light);
    flex-shrink: 0;
}

.project-card .card-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.project-name {
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-desc {
    font-size: 0.73rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== PUBLIC TOOLS (Login Section) ========== */
.public-tools-section {
    margin-top: 24px;
    width: 100%;
    max-width: 960px;
}

.public-tools-section .cat-label {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.menu-grid-public {
    max-width: 960px;
}

.menu-grid-public .project-card {
    padding: 14px;
    gap: 10px;
}

.menu-grid-public .card-icon {
    width: 34px;
    height: 34px;
    font-size: 1.1rem;
}

.menu-grid-public .project-name {
    font-size: 0.85rem;
}

.menu-grid-public .project-desc {
    font-size: 0.7rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    body { padding: 16px; }
    h1.brand-title { font-size: 1.6rem; letter-spacing: 2px; }
    h1.dashboard-title { font-size: 1.6rem; }
    .subtitle { margin-bottom: 28px; font-size: 0.85rem; }

    .header-container {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 20px;
    }

    .logout-btn { align-self: flex-end; }

    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .project-card {
        padding: 12px;
        gap: 10px;
        border-radius: 8px;
    }

    .project-card .card-icon {
        width: 34px;
        height: 34px;
        font-size: 1.1rem;
        border-radius: 7px;
    }

    .project-name { font-size: 0.82rem; }
    .project-desc { font-size: 0.68rem; -webkit-line-clamp: 1; }

    .cat-label { font-size: 0.65rem; margin-bottom: 8px; }
    .cat-label:not(:first-child) { margin-top: 18px; }

    .login-container { padding: 28px 20px; }
    .public-tools-section { margin-top: 20px; }
}

@media (max-width: 480px) {
    body { padding: 12px; }
    h1.brand-title { font-size: 1.3rem; }
    h1.dashboard-title { font-size: 1.3rem; }

    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .project-card { padding: 10px; gap: 8px; }
    .project-card .card-icon { width: 30px; height: 30px; font-size: 1rem; border-radius: 6px; }
    .project-name { font-size: 0.78rem; }
    .project-desc { display: none; }
}
