/* Fresh & Clean Design for SecureVault (Light Theme) */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --primary-color: #6366f1;
    --primary-light: #e0e7ff;
    --bg-light: #f8fafc;
    --card-bg: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --danger-red: #ef4444;
    --accent-blue: #3b82f6;
    --success-green: #22c55e;
    --explorer-bg: #ffffff;
    --explorer-sidebar: #f5f6f7;
    --explorer-border: #e1e4e8;
    --explorer-accent: #0078d4;
    --explorer-hover: #e5e5e5;
    --explorer-selected: #cce8ff;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    font-family: 'Outfit', sans-serif;
    margin: 0;
    padding: 0;
}

body.dashboard-page,
body.is-logged-in {
    overflow: hidden;
    height: 100vh;
}

body.dashboard-page {
    background-color: #f0f2f5;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.navbar {
    background-color: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 16px 0;
}

.hero-section {
    position: relative;
    padding: 140px 0 80px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(248, 250, 252, 0.2), var(--bg-light));
    z-index: 1;
}

.relative-content {
    position: relative;
    z-index: 2;
}

.glass-card {
    background: var(--card-bg);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.btn-primary {
    background-color: var(--primary-color);
    border: none;
    border-radius: 12px;
}

/* === DESKTOP HEADER === */
.universal-keys-bar {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-bottom: 1px solid var(--explorer-border);
    padding: 8px 20px;
    z-index: 1000;
    position: sticky;
    top: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: grid;
    grid-template-columns: 250px 1fr 400px;
    gap: 20px;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar-brand {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-dark) !important;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.header-center {
    display: flex;
    justify-content: center;
}

.key-inputs-group {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: white;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--explorer-border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.input-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin: 0;
}

.input-wrapper input {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 12px;
    min-width: 160px;
    transition: all 0.2s;
}

.input-wrapper input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: none;
}

.lock-btn {
    padding: 6px 12px !important;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s;
}

.lock-btn:hover {
    transform: scale(1.05);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: flex-end;
}

.add-btn {
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
    transition: all 0.2s;
}

.add-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.username {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.mobile-menu-btn {
    display: none;
}

/* EXPLORER LAYOUT */
.explorer-container {
    display: flex;
    height: calc(100vh - 80px - 40px);
    background: var(--explorer-bg);
    overflow: hidden;
}

/* STATUS BAR */
.explorer-footer {
    height: 40px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-top: 1px solid var(--explorer-border);
    display: flex;
    align-items: center;
    padding: 0 15px;
    font-size: 11px;
    color: #444;
    gap: 10px;
    z-index: 1000;
    overflow-x: hidden;
    overflow-y: hidden;
}

.pass-gen-box {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border: 1px solid var(--explorer-border);
    border-radius: 4px;
    padding: 2px 6px;
    margin-left: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    flex-shrink: 1;
    min-width: 0;
    max-width: 100%;
}

.pass-gen-box>div {
    flex-shrink: 1;
    min-width: 0;
}

.pass-gen-check {
    font-size: 9px;
    white-space: nowrap;
}

.pass-gen-input {
    border: none;
    font-family: 'Courier New', monospace;
    font-size: 9px;
    flex: 1;
    min-width: 200px;
    max-width: 500px;
    background: transparent;
    outline: none;
    font-weight: 600;
    overflow-x: auto;
    white-space: nowrap;
}

.pass-gen-input::-webkit-scrollbar {
    height: 3px;
}

.pass-gen-input::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.pass-gen-btn {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--explorer-accent);
    font-size: 13px;
    padding: 2px 3px;
    border-radius: 4px;
    transition: all 0.2s;
}

.pass-gen-btn:hover {
    background: var(--explorer-hover);
}

.pass-gen-check {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
}

/* Sidebar */
.explorer-sidebar {
    width: 240px;
    background: var(--explorer-sidebar);
    border-right: 1px solid var(--explorer-border);
    overflow-y: auto;
    padding: 20px 0;
}

.explorer-sidebar h6 {
    padding: 0 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.cat-item {
    padding: 8px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: #333;
    border-left: 3px solid transparent;
    transition: all 0.15s;
    font-weight: 500;
}

.cat-label {
    display: flex;
    align-items: center;
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cat-actions {
    display: none;
    gap: 8px;
    margin-left: 10px;
}

.cat-item:hover .cat-actions {
    display: flex;
}

.cat-action-btn {
    opacity: 0.4;
    cursor: pointer;
    transition: opacity 0.2s;
    font-size: 12px;
}

.cat-action-btn:hover {
    opacity: 1;
}

.cat-item:hover {
    background: var(--explorer-hover);
}

.cat-item.active {
    background: var(--explorer-selected);
    color: var(--explorer-accent);
    border-left-color: var(--explorer-accent);
    font-weight: 600;
}

.cat-label::before {
    content: "\1F4C1";
    margin-right: 10px;
    font-size: 15px;
}

/* Main Content */
.explorer-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fafbfc;
}

.explorer-toolbar {
    min-height: 50px;
    border-bottom: 1px solid var(--explorer-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: #fff;
    gap: 15px;
}

.explorer-toolbar>div {
    display: flex;
    align-items: center;
    min-height: 50px;
}

.explorer-toolbar #itemCount {
    height: auto;
}

.explorer-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

/* === NOTEPAD-STYLE EDITOR === */
.notepad-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
}

.notepad-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f0f0f0;
    border-bottom: 1px solid #ccc;
    gap: 10px;
}

.notepad-title {
    flex: 1;
    border: none;
    background: white;
    padding: 6px 10px;
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    border: 1px solid #ccc;
    border-radius: 2px;
}

.notepad-title:focus {
    outline: 1px solid #0078d4;
    outline-offset: -1px;
}

.notepad-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.notepad-select {
    border: 1px solid #ccc;
    background: white;
    padding: 5px 8px;
    font-size: 13px;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    border-radius: 2px;
    min-width: 120px;
}

.notepad-select:focus {
    outline: 1px solid #0078d4;
    outline-offset: -1px;
}

.notepad-btn {
    border: 1px solid #ccc;
    background: white;
    padding: 5px 10px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.1s;
}

.notepad-btn:hover {
    background: #e5e5e5;
    border-color: #adadad;
}

.notepad-btn:active {
    background: #ccc;
}

.notepad-btn-save:hover {
    background: #e7f4e7;
}

.notepad-btn-delete:hover {
    background: #ffe5e5;
}

.notepad-content {
    flex: 1;
    border: none;
    padding: 15px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: none;
    background: white;
    color: #000;
    outline: none;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
}

.notepad-content::selection {
    background: #0078d4;
    color: white;
}

/* Secret Items - Grid View (Windows Icon Style) */
#secretList.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    padding: 8px;
}

#secretList.grid-view .secret-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.1s;
    border: 1px solid transparent;
    background: transparent;
}

#secretList.grid-view .secret-item:hover {
    background: #e5f3ff;
    border-color: #cce8ff;
}

#secretList.grid-view .secret-item.active {
    background: #cce8ff;
    border-color: #99d1ff;
}

#secretList.grid-view .secret-item .file-icon {
    font-size: 32px;
    margin-bottom: 4px;
}

#secretList.grid-view .secret-item .file-title {
    font-size: 11px;
    font-weight: 400;
    line-height: 1.2;
    color: var(--text-dark);
    word-break: break-word;
    max-width: 100%;
}

/* Secret Items - List View (Windows Details Style) */
#secretList.list-view {
    display: flex;
    flex-direction: column;
}

#secretList.list-view .secret-item {
    display: grid;
    grid-template-columns: 24px 1fr 120px;
    gap: 10px;
    align-items: center;
    padding: 3px 10px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    font-size: 12px;
    background: white;
    transition: all 0.1s;
    min-height: 28px;
}

#secretList.list-view .secret-item:hover {
    background: #e5f3ff;
}

#secretList.list-view .secret-item.active {
    background: #cce8ff;
}

#secretList.list-view .secret-item .file-icon {
    font-size: 20px;
    text-align: center;
}

#secretList.list-view .secret-item .file-title {
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#secretList.list-view .secret-item .file-date {
    font-size: 11px;
    color: #666;
    text-align: right;
}

/* Details/Reader Area */
.explorer-details {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow: hidden;
    border-left: 1px solid var(--explorer-border);
}

.mobile-back-header {
    display: none;
    min-height: 50px;
    height: 50px;
    padding: 0 20px !important;
}

.mobile-back-header h6 {
    line-height: 1;
    margin: 0;
}

.mobile-back-header .btn {
    height: auto;
}

.reader-content-box {
    padding: 40px;
}

.reader-empty {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0.4;
}

.extra-small {
    font-size: 11px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-f-in {
    animation: fadeIn 0.3s ease;
}

/* Modals */
.modal-content {
    border-radius: 20px !important;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.form-control,
.form-select {
    border-radius: 10px;
    padding: 10px 15px;
    border: 1px solid #e5e7eb;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* === MOBILE OPTIMIZATION === */
@media (max-width: 992px) {
    body.dashboard-page {
        overflow-y: auto;
    }

    /* Mobile Header */
    .universal-keys-bar {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px;
        background: white;
    }

    .header-left {
        justify-content: flex-start;
        width: 100%;
        gap: 15px;
        position: relative;
    }

    .mobile-menu-btn {
        position: static;
        transform: none;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        background: var(--bg-light);
        border: 1px solid var(--explorer-border);
        border-radius: 8px;
        width: 40px;
        height: 40px;
        font-size: 18px;
        padding: 0;
        flex-shrink: 0;
    }

    .navbar-brand {
        text-align: left;
        flex: 1;
    }

    .key-inputs-group {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }

    .input-wrapper {
        width: 100%;
    }

    .input-wrapper input {
        width: 100%;
        min-width: auto;
    }

    .lock-btn {
        width: 100%;
    }

    .header-right {
        flex-direction: column;
        gap: 10px;
    }

    .add-btn {
        width: 100%;
    }

    .user-menu {
        width: 100%;
        justify-content: space-between;
    }

    /* Explorer Container */
    .explorer-container {
        height: calc(100vh - 280px - 40px);
        flex-direction: column;
    }

    .explorer-footer {
        display: flex !important;
        height: 40px;
        min-height: 40px;
    }

    /* Mobile Grid View - Compact */
    #secretList.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 6px;
        padding: 6px;
    }

    #secretList.grid-view .secret-item {
        padding: 6px 2px;
    }

    #secretList.grid-view .secret-item .file-icon {
        font-size: 28px;
        margin-bottom: 3px;
    }

    #secretList.grid-view .secret-item .file-title {
        font-size: 10px;
    }

    /* Mobile List View - Compact */
    #secretList.list-view .secret-item {
        grid-template-columns: 20px 1fr;
        padding: 6px 8px;
        min-height: 36px;
    }

    #secretList.list-view .secret-item .file-icon {
        font-size: 18px;
    }

    #secretList.list-view .secret-item .file-title {
        font-size: 13px;
    }

    #secretList.list-view .secret-item .file-date {
        display: none;
    }

    /* Hide Sidebar by Default */
    .explorer-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        z-index: 2100;
        height: 100vh;
        width: 280px;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 15px 0 50px rgba(0, 0, 0, 0.15);
    }

    .explorer-sidebar.mobile-open {
        transform: translateX(280px);
    }

    /* Main Content */
    .explorer-main {
        width: 100%;
        flex: 1;
    }

    .mobile-menu-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        background: var(--bg-light);
        border: 1px solid var(--explorer-border);
        border-radius: 8px;
        width: 40px;
        height: 40px;
        font-size: 18px;
        padding: 0;
    }

    /* Toolbar */
    .explorer-toolbar {
        flex-wrap: wrap;
        height: auto;
        padding: 12px;
        gap: 10px;
    }

    /* Grid View */
    #secretList.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 12px;
        padding: 5px;
    }

    #secretList.grid-view .secret-item {
        padding: 15px 8px;
    }

    #secretList.grid-view .secret-item .file-icon {
        font-size: 36px;
    }

    #secretList.grid-view .secret-item .file-title {
        font-size: 12px;
    }

    /* Details Pane */
    .explorer-details {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        z-index: 2200;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .explorer-details.mobile-open {
        transform: translateX(0);
    }

    .mobile-back-header {
        display: flex !important;
        background: #fff;
        position: sticky;
        top: 0;
        z-index: 10;
        box-shadow: 0 1px 10px rgba(0, 0, 0, 0.05);
        padding: 12px 15px !important;
    }

    .reader-content-box {
        padding: 20px 15px;
    }

    /* Footer */
    .explorer-footer {
        flex-direction: column;
        height: auto;
        padding: 12px 15px;
        gap: 10px;
    }

    .pass-gen-box {
        width: 100%;
        flex-wrap: wrap;
        padding: 10px;
    }

    .pass-gen-input {
        min-width: 150px;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .pass-gen-box {
        display: none;
    }

    .explorer-footer {
        padding: 0 15px;
        justify-content: flex-start;
        display: flex !important;
    }

    .explorer-footer>div {
        display: flex !important;
    }

    /* Notepad Toolbar - Mobile Responsive */
    .notepad-toolbar {
        flex-wrap: wrap;
        padding: 6px 8px;
        gap: 6px;
    }

    .notepad-title {
        width: 100%;
        order: 1;
        font-size: 13px;
        padding: 8px;
    }

    .notepad-actions {
        width: 100%;
        order: 2;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 4px;
    }

    .notepad-select {
        flex: 1;
        min-width: 120px;
        font-size: 12px;
    }

    .notepad-btn {
        padding: 6px 12px;
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    #secretList.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    }
}

/* === NEW LANDING STYLES === */
.hero-badge {
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 99px;
    font-weight: 600;
    font-size: 14px;
    display: inline-block;
    margin-bottom: 24px;
}

.hero-img-container {
    padding: 20px;
    background: white;
    border-radius: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    transform: perspective(1000px) rotateY(-5deg);
    transition: transform 0.5s ease;
}

.hero-img-container:hover {
    transform: perspective(1000px) rotateY(0deg);
}

.hero-img-container img {
    border-radius: 20px;
    width: 100%;
    height: auto;
}

.section-padding {
    padding: 100px 0;
}

.algo-card {
    border: 1px solid rgba(0, 0, 0, 0.03);
    border-radius: 32px;
    transition: all 0.3s ease;
    height: 100%;
    padding: 40px;
    background: #fdfdfd;
}

.algo-card:hover {
    background: white;
    transform: translateY(-8px);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.1);
}

.algo-icon-box {
    width: 60px;
    height: 60px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 30px;
}

.security-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f0fdf4;
    color: #16a34a;
    border-radius: 99px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
}

.feat-icon {
    font-size: 48px;
    margin-bottom: 25px;
}

.bg-gradient-soft {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

/* Animations */
.animate-up {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.animate-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

/* Responsive Fixes */
@media (max-width: 991px) {
    .section-padding {
        padding: 60px 0;
    }

    .hero-img-container {
        transform: none;
        margin-top: 50px;
    }
}