/*
 * Camjacking Version 2.0 - UI Stylesheet
 * ---------------------------------------
 *
 * Author      : Akash K
 * LinkedIn    : https://www.linkedin.com/in/akash-k-83223b224/
 * GitHub      : https://github.com/Cappricio-Securities/camjacking
 *
 * License     : Open-source — for educational and authorized
 *               cybersecurity training purposes only.
 *
 * Legal Notice:
 * Use this stylesheet responsibly and ethically.
 */

/* =========================================================
   1. FONT DEFINITIONS
========================================================= */

@font-face {
    font-family: 'labsAmiga';
    src: url('../fonts/labsAmiga.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}


/* =========================================================
   2. ROOT VARIABLES
========================================================= */

:root {
    --nav-height: 90px;
}


/* =========================================================
   3. GLOBAL RESET & BASE STYLES
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

::selection {
    background: #ff6a00;
    color: #fff;
}

body {
    font-family: 'Tektur', sans-serif;
    background-color: #f8f8f8;
    background-image:
        linear-gradient(to right, #9e9e9e 1px, transparent 1px),
        linear-gradient(to bottom, #9e9e9e 1px, transparent 1px);
    background-size: 460px 520px;
    color: #111;
}


/* =========================================================
   4. NAVBAR
========================================================= */

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 60px;
    height: var(--nav-height);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #f8f8f8;
    z-index: 1000;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    font-family: 'labsAmiga', sans-serif;
}

.logout-btn {
    background: #ff6a00;
    padding: 12px 30px;
    color: black;
    border: 1px solid #ff6a00;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    clip-path: polygon(13px 0,
            100% 0,
            100% calc(100% - 10px),
            calc(100% - 10px) 100%,
            0 100%,
            0 9px);
}

.scramble {
    display: inline-block;
    position: relative;
    border: 1px solid #ff6a00;
    overflow: hidden;
}


/* =========================================================
   5. MAIN LAYOUT
========================================================= */

.dashboard {
    display: block;
    padding-top: 90px;
    min-height: calc(100vh - 90px);
}

.main {
    padding: 50px;
    margin-left: 260px;
}

@media (max-width: 768px) {
    .main {
        padding: 25px;
    }
}


/* =========================================================
   6. SIDEBAR
========================================================= */

.sidebar {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 260px;
    height: calc(100vh - var(--nav-height));
    padding: 40px 30px;
    border-right: 2px solid #111;
    background: #ffffff;
    box-shadow: 6px 0 0 #111;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
    z-index: 999;
}

.sidebar a {
    text-decoration: none;
    color: #111;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    padding: 12px 18px;
    margin-top: 10px;
    border: 2px solid #111;
    background: #fff;
    transition: all 0.15s ease;
    display: block;
    position: relative;
}

.sidebar a:hover {
    background: #ff6a00;
    transform: translateX(5px);
    box-shadow: 4px 4px 0 #111;
}

.sidebar a.active {
    background: #111;
    margin-bottom: 10px;
    color: #fff;
}


/* =========================================================
   7. CARDS
========================================================= */

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 50px;
}

.card {
    border: 2px solid #111;
    padding: 40px;
    background: #ffffff;
    box-shadow: 8px 8px 0 #111;
}

.card h3 {
    font-size: 40px;
    margin-bottom: 10px;
}

.card p {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    opacity: 0.7;
}


/* =========================================================
   8. CONTENT PANEL
========================================================= */

.panel {
    border: 1.5px solid rgba(0, 0, 0, 0.25);
    padding: 60px;
    min-height: 300px;
}


/* =========================================================
   9. RESPONSIVE GRID ADJUSTMENTS
========================================================= */

@media (max-width: 1000px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    .cards {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   10. CHARTS
========================================================= */

.charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.chart-card {
    background: #ffffff;
    border: 2px solid #111;
    padding: 20px;
    min-height: 260px;
    box-shadow: 6px 6px 0 #111;
}

.chart-card canvas {
    height: 450px !important;
    max-height: 520px;
}

@media (max-width: 1000px) {
    .charts {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   11. ATTACK TABLE WRAPPER
========================================================= */

.attack-wrapper {
    background: #ffffff;
    border: 2px solid #111;
    box-shadow: 6px 6px 0 #111;
    padding: 20px;
}

.attack-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
    font-family: 'Inter', sans-serif;
}

.attack-table th {
    text-align: left;
    padding: 18px;
    font-size: 14px;
    letter-spacing: 1px;
    background: #ff6a00;
    color: #000;
}

.attack-table td {
    padding: 20px 18px;
    border-bottom: 1.5px solid #111;
    font-size: 14px;
}

.attack-table tbody tr {
    transition: background 0.2s ease;
}

.attack-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.04);
}
#attackDetailsSection{
    margin-left: 0%!important;
}


/* =========================================================
   12. BUTTONS
========================================================= */

.mini-btn {
    background: #ff6a00;
    border: none;
    padding: 10px 24px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    cursor: pointer;
    clip-path: polygon(8px 0,
            100% 0,
            100% calc(100% - 6px),
            calc(100% - 6px) 100%,
            0 100%,
            0 8px);
    transition: transform 0.15s ease;
}

.mini-btn:hover {
    transform: translateY(-2px);
}

.delete-btn {
    background: #d62828;
    border: none;
    margin-left: 10px;
    padding: 10px 24px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    cursor: pointer;
    clip-path: polygon(8px 0,
            100% 0,
            100% calc(100% - 6px),
            calc(100% - 6px) 100%,
            0 100%,
            0 8px);
    transition: transform 0.15s ease;
}

.delete-btn:hover {
    opacity: 0.85;
}


/* =========================================================
   13. FILTER BAR
========================================================= */

.filter-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.filter-bar input {
    padding: 10px;
    border: 2px solid #111;
    font-family: 'Inter', sans-serif;
}


/* =========================================================
   14. DETAIL VIEW
========================================================= */

.detail-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.back-btn {
    cursor: pointer;
    font-weight: 700;
    font-size: 18px;
}

.detail-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: left;
    width: 50%;
    margin-bottom: 30px;
    font-family: 'Inter', sans-serif;
}

/* Top detail grid that sits above the table in the detailed view */
.detail-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    align-items: stretch;
}
.detail-grid .grid-card {
    background: #fff;
    border: 2px solid #111;
    padding: 12px 14px;
    min-width: 160px;
    flex: 1 1 160px;
    box-shadow: 4px 4px 0 #111;
}
.detail-grid .grid-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
}
.detail-grid .grid-value {
    font-weight: 700;
}


/* =========================================================
   15. GALLERY
========================================================= */

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
}

.boxgl {
    width: 100%;
    align-items: right;
    display: flex;
    align-items: right;
    justify-content: right;
}

.gallery-box {
 
    width: 120px;
    height: 120px;
    align-items: end;
    border: 2px solid #111;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ff6a00;
    color: #000;
    font-weight: 700;
    cursor: pointer;
    opacity: 0.98;
    margin-bottom: 20px;
    box-shadow: 6px 6px 0 #111;
    transition: all 0.15s ease;
}

.gallery-box:hover {
    transform: translateY(-3px);
    box-shadow: 8px 8px 0 #111;
}


/* Detail table scrollable wrapper (Detailed View only) */
.detail-table-wrapper {
    max-height: 340px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.detail-table-wrapper .attack-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-table-wrapper .attack-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #ff6a00;
}

.detail-table-wrapper .attack-table tbody tr:hover {
    background: rgba(0,0,0,0.04);
}

/* Place gallery on the right and stack detail content on the left for the details section */
#attackDetailsSection .attack-wrapper {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

#attackDetailsSection .detail-main {
    flex: 1 1 auto;
    min-width: 0;
}

#attackDetailsSection .gallery-box {
    flex: 0 0 160px;
    height: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.detail-top{
    display: flex;
    
    margin-bottom: 20px;
}




/* =========================================================
   16. SUMMARY CARDS
========================================================= */

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.summary-card {
    background: #fff;
    border: 2px solid #111;
    padding: 20px;
    box-shadow: 4px 4px 0 #111;
}


/* =========================================================
   17. TOAST NOTIFICATIONS
========================================================= */

#toastContainer {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.toast {
    min-width: 280px;
    padding: 18px 25px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    background: #ffffff;
    border: 2px solid #111;
    box-shadow: 6px 6px 0 #111;
    animation: slideIn 0.3s ease forwards;
}

.toast.error {
    background: #e53935;
    color: #fff;
}

.toast.success {
    background: #ff6a00;
    color: #000;
}

@keyframes slideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(120%);
    }
}


/* =========================================================
   18. PROFILE SIDEBAR BOX
========================================================= */

.profile-box {
    border: 2px solid #111;
    padding: 15px;
    display: flex;
    align-items: center;
    position: absolute;
    bottom: 40px;
    left: 30px;
    right: 30px;
    gap: 12px;
    cursor: pointer;
    transition: 0.15s ease;
    background: #fff;
    width: 180px;
}

.profile-box:hover {
    background: #ff6a00;
    transform: translateY(-3px);
    box-shadow: 4px 4px 0 #111;
}

.profile-icon {
    font-size: 22px;
}

.profile-name {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}


/* =========================================================
   19. PROFILE SETTINGS & FORMS
========================================================= */

.profile-settings {
    flex-direction: column;
    gap: 25px;
    max-width: 500px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-row label {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
}

.form-row input {
    height: 60px;
    padding: 0 20px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    border: 2px solid #111;
    outline: none;
    background: #fff;
    box-shadow: 5px 5px 0 #111;
    transition: all 0.15s ease;
}

.form-row input:focus {
    background: #ff6a00;
    color: #000;
    transform: translateY(-3px);
    box-shadow: 7px 7px 0 #111;
}


/* =========================================================
   20. PROFILE CARD STRUCTURE
========================================================= */

.profile-update-btn {
    width: fit-content;
    padding: 14px 35px;
    margin-top: 10px;
}

.profile-view-row {
    display: flex;
    justify-content: space-between;
    padding: 18px 0;
    border-bottom: 1px solid #ddd;
    font-family: 'Inter', sans-serif;
}

.profile-view-row span {
    font-weight: 600;
    opacity: 0.7;
}

.profile-view-row strong {
    font-weight: 700;
}

.profile-card {
    max-width: 650px;
    width: 100%;
    margin: 40px auto;
    padding: 50px;
    background: #fff;
    border: 2px solid #111;
    box-shadow: 10px 10px 0 #111;
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.profile-header h2 {
    font-size: 28px;
    font-weight: 800;
}

.profile-view {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.profile-row {
    display: flex;
    justify-content: space-between;
    padding: 18px 20px;
    border: 2px solid #111;
    background: #fafafa;
    box-shadow: 5px 5px 0 #111;
}

.profile-label {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    opacity: 0.7;
}

.profile-value {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
}


/* =========================================================
   21. PROFILE EDIT MODE
========================================================= */

.edit-btn {
    background: #ff6a00;
    padding: 12px 30px;
    color: black;
    border: 1px solid #ff6a00;
    cursor: pointer;
    margin-top: 20px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    clip-path: polygon(13px 0,
            100% 0,
            100% calc(100% - 10px),
            calc(100% - 10px) 100%,
            0 100%,
            0 9px);
}

.edit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 8px 8px 0 #111;
}

.profile-edit {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.profile-buttons {
    display: flex;
    gap: 20px;
}

.cancel-btn {
    background: #ff6a00;
    padding: 12px 30px;
    color: black;
    border: 1px solid #ff6a00;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    clip-path: polygon(13px 0,
            100% 0,
            100% calc(100% - 10px),
            calc(100% - 10px) 100%,
            0 100%,
            0 9px);
}

.cancel-btn:hover {
    transform: translateY(-3px);
}


/* =========================================================
   22. RESPONSIVE BEHAVIOR
========================================================= */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

@media (max-width: 1024px) {
    .dashboard {
        grid-template-columns: 220px 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    nav {
        padding: 20px;
    }

    .logo {
        font-size: 20px;
    }

    .logout-btn {
        padding: 8px 18px;
        font-size: 12px;
    }

    #attacksSection,
    #attackDetailsSection,
    #profileSection {
        padding: 20px;
    }

    .sidebar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 20px;
        border-right: none;
        border-bottom: 2px solid #111;
        box-shadow: 0 6px 0 #111;
    }

    .sidebar-top {
        display: flex;
        gap: 15px;
    }

    .profile-box {
        position: static;
        width: auto;
        padding: 10px 15px;
    }
}


/* =========================================================
   23. HAMBURGER & MOBILE SIDEBAR
========================================================= */

.hamburger {
    font-size: 22px;
    cursor: pointer;
    display: none;
}

#sidebarOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(3px);
    display: none;
    z-index: 998;
}

@media (max-width: 768px) {

    .hamburger {
        display: block;
    }

    .dashboard {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        height: 100vh;
        width: 260px;
        background: #fff;
        z-index: 999;
        transition: left 0.3s ease;
        box-shadow: 6px 0 0 #111;
    }

    .sidebar.active {
        left: 0;
    }

    #sidebarOverlay.active {
        display: block;
    }

    .profile-box {
        position: absolute;
        bottom: 40px;
        left: 30px;
        right: 30px;
        width: auto;
    }
}


/* =========================================================
   24. UTILITIES
========================================================= */

.attack-count {
    color: #ff6a00;
}

.tdControl {
    height: calc(100vh - 200px);
    overflow-y: auto;
    overflow-x: hidden;
}

.profile-wrapper {
    min-width: calc(100vh - 40px);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* =========================================================
   25. TEMPLATE SELECTION
========================================================= */

#templatesSection {
    margin-left: 260px;
}

.template-tabs {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.template-tabs .mini-btn {
    background: #fff;
    border: 2px solid #111;
}

.template-tabs .active-tab {
    background: #ff6a00;
    color: #000;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
}

.template-card {
    background: #fff;
    border: 2px solid #111;
    padding: 40px;
    box-shadow: 6px 6px 0 #111;
    font-weight: 700;
    cursor: pointer;
    transition: 0.15s ease;
}

.template-card:hover {
    transform: translateY(-4px);
    box-shadow: 10px 10px 0 #111;
}