* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

[data-bs-theme="light"] {
    --bs-body-color: #212529;
    --bs-body-color-secondary: #8a9199;
    --bs-body-color-hover: #212529;
    --bs-body-ascii: #2d333b;
    --bs-body-bg: #ffffff80;
    --bs-body-bg-hover: #3b3b3b15;
    --bs-body-header-bg: #ffffffcc;
    --logo-theme: "-light";
}

[data-bs-theme="dark"] {
    color-scheme: dark;
    --bs-body-color: #dee2e6;
    --bs-body-color-hover: #bac5d0;
    --bs-body-ascii: #525963;
    --bs-body-bg: #0a0e14;
    --bs-body-header-bg: #161b22;
    --bs-body-bg-visible: #66666691;
    --logo-theme: "";
}

body {
    font-family: 'Courier New', monospace;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
    /*padding-left: 0px;*/
    overflow-y: scroll;
    /*scrollbar-width: none; */ /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer and Edge */
}

body::-webkit-scrollbar {
    display: none; /* Chrome, Safari, and Opera */
}


.terminal {
    max-width: 1000px;
    margin: 0 auto;
    border: 1px solid #1f2430;
    background: var(--bs-body-bg);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.terminal-header {
    background: var(--bs-body-header-bg);
    border-bottom: 1px solid #1f2430;
    color: #8a9199;
    padding: 10px 15px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
}

.terminal-button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #1f2430;
}

.terminal-header-right {
    margin-left: auto;
}

.theme-switch {
    font-size: 1.2em;
    background: none;
    border: none;
    color: #8a9199;
    cursor: pointer;
    transition: color 0.2s;
}

.terminal-title {
    margin-left: 10px;
    font-size: 0.9em;
}

.terminal-body {
    padding: 30px;
    min-height: 600px;
}

.prompt {
    color: #59c2ff;
    margin-bottom: 5px;
}

.prompt::before {
    content: '$ ';
    color: #73d0ff;
}

.output {
    margin: 10px 0 20px 0;
    color: #6c7380;
    overflow-wrap: break-word;
}

.menu-box {
    border: 1px solid #1f2430;
    padding: 25px;
    margin: 25px 0;
    background: var(--bs-body-bg);
}

.menu-title {
    text-align: center;
    font-size: 1.3em;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #1f2430;
    color: var(--bs-body-color);
}

.menu-item {
    padding: 14px 20px;
    margin: 10px 0;
    border: 1px solid #1f2430;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    background: var(--bs-body-bg);
    color: var(--bs-body-color-secondary);
}

.menu-item:hover {
    background: var(--bs-body-bg-hover);
    border-color: #2d333b;
    color: var(--bs-body-color-hover);
    transform: translateX(3px);
}

.menu-item::before {
    content: '▸ ';
    margin-right: 10px;
    color: #59c2ff;
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.back-button {
    display: inline-block;
    padding: 10px 20px;
    margin: 25px 0;
    border: 1px solid #1f2430;
    cursor: pointer;
    background: var(--bs-body-bg);
    transition: all 0.2s;
    color: var(--bs-body-color);
}

.back-button:hover {
    background: var(--bs-body-bg);
    border-color: #2d333b;
    color: var(--bs-body-color);
    transform: translateX(3px);
}

.back-button::before {
    content: '← ';
}

.post-list {
    margin: 20px 0;
}

.post-item {
    border: 1px solid #1f2430;
    padding: 20px;
    margin: 15px 0;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bs-body-bg);
}

.post-item:hover {
    background: var(--bs-body-bg);
    border-color: #2d333b;
}

.post-date {
    font-size: 0.85em;
    color: #59c2ff;
    margin-bottom: 10px;
}

.post-title {
    font-size: 1.3em;
    margin-bottom: 12px;
    color: var(--bs-body-color);
}

.post-excerpt {
    color: #8a9199;
    line-height: 1.8;
    margin-bottom: 12px;
}

.post-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.tag {
    font-size: 0.8em;
    padding: 4px 10px;
    border: 1px solid #1f2430;
    color: var(--bs-body-color);
    background: var(--bs-body-bg);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.info-box {
    border: 1px solid #1f2430;
    padding: 25px;
    text-align: center;
    background: var(--bs-body-bg);
}

.row {
    display:flex;
    justify-content:space-around;
    align-items:center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.info-number {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #73d0ff;
}

.info-label {
    font-size: 0.9em;
    color: #6c7380;
}

.text-block {
    padding: 20px;
    border-left: 2px solid #2d333b;
    background: var(--bs-body-bg);
    margin: 20px 0;
    line-height: 1.8;
    color: var(--bs-body-color);
}

.ctf-item {
    border: 1px solid #1f2430;
    padding: 20px;
    margin: 15px 0;
    background: var(--bs-body-bg);
}

.ctf-name {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: var(--bs-body-color);
}

.ctf-desc {
    color: #8a9199;
    line-height: 1.7;
    margin-bottom: 10px;
}

.ctf-rank {
    font-size: 0.9em;
    color: #59c2ff;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.skill-column {
    border: 1px solid #1f2430;
    padding: 2px;
    text-align: center;
    font-size: 0.9em;
    background: var(--bs-body-bg);
    transition: all 0.2s;
    color: #8a9199;
}

.skill-box {
    border: 1px solid #1f2430;
    padding: 15px;
    margin-bottom: 5px;
    text-align: center;
    font-size: 0.9em;
    background: var(--bs-body-bg);
    transition: all 0.2s;
    color: #8a9199;
}

.skill-box:hover {
    background: var(--bs-body-bg-hover);
    border-color: #2d333b;
    color: var(--bs-body-color-hover);
}

.contact-list {
    margin: 20px 0;
}

.contact-item {
    padding: 14px 20px;
    margin: 10px 0;
    border: 1px solid #1f2430;
    background: var(--bs-body-bg);
    transition: all 0.2s;
}

.contact-item:hover {
    background: var(--bs-body-bg-hover);
    border-color: #2d333b;
}

.contact-item a {
    color: var(--bs-body-color);
    text-decoration: none;
    transition: color 0.2s;
}

.contact-item a:hover {
    color: var(--bs-body-color-hover);
}

.contact-item::before {
    content: '▸ ';
    color: #59c2ff;
    margin-right: 10px;
}

.blink {
    animation: blink 1.2s ease-in-out infinite;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.separator {
    border-top: 1px solid #1f2430;
    margin: 30px 0;
}

h2 {
    font-size: 1.5em;
    margin: 30px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #1f2430;
    color: var(--bs-body-color);
    font-weight: normal;
}



.ascii-border {
    color: var(--bs-body-ascii);
    font-size: 0.9em;
    text-align: center;
    margin: 20px 0;
    white-space-collapse: preserve;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .terminal {
        border: 1px solid #1f2430;
    }

    .terminal-body {
        padding: 20px;
    }

    .info-grid, .skills-grid {
        grid-template-columns: 1fr;
    }

    .ascii-border {
      display: none;
  }
}

/* Search Bar Styles */
.search-container {
    margin: 20px 0;
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    background: var(--bs-body-bg);
    border: 1px solid #1f2430;
    padding: 10px 15px;
    color: var(--bs-body-color);
    font-family: 'Courier New', monospace;
    outline: none;
    transition: all 0.2s;
}

.search-input:focus {
    border-color: #59c2ff;
    box-shadow: 0 0 5px rgba(89, 194, 255, 0.2);
}

.search-input::placeholder {
    color: #4a505b;
}

/* Challenge List Styles (reusing post-item somewhat but simplified) */
.challenge-item {
    border: 1px solid #1f2430;
    padding: 15px;
    margin: 10px 0;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bs-body-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.challenge-item:hover {
    background: var(--bs-body-bg-hover);
    border-color: #2d333b;
    transform: translateX(3px);
}

.challenge-title {
    color: var(--bs-body-color);
    font-size: 1.1em;
}

.challenge-meta {
    font-size: 0.8em;
    color: #6c7380;
    display: flex;
    gap: 10px;
    align-items: center;
}

.category-tag {
    padding: 2px 8px;
    border: 1px solid #2d333b;
    border-radius: 3px;
    color: #59c2ff;
    font-size: 0.85em;
}

/* Writeup Content Styles */
.writeup-content {
    margin-top: 20px;
    color: var(--bs-body-color);
}

.writeup-content h2, 
.writeup-content h3, 
.writeup-content h4 {
    margin: 25px 0 15px 0;
    color: var(--bs-body-color);
    border-bottom: 1px solid #1f2430;
    padding-bottom: 5px;
    font-weight: normal;
}

.writeup-content p {
    margin-bottom: 15px;
    line-height: 1.7;
}

.writeup-content ul {
    margin: 15px 0;
    padding-left: 25px;
}

.writeup-content li {
    margin-bottom: 8px;
}

.writeup-content pre {
    background: var(--bs-body-bg);
    border: 1px solid #1f2430;
    padding: 15px;
    overflow-x: auto;
    margin: 15px 0;
}

.writeup-content code {
    font-family: 'Courier New', monospace;
    color: #73d0ff;
    line-height: 0.7;
}

.writeup-content pre code {
    color: var(--bs-body-color);
    display: block;
}

.writeup-content strong {
    color: var(--bs-body-color-secondary);
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #1f2430;
}

.pagination-btn {
    padding: 8px 16px;
    background: var(--bs-body-bg);
    border: 1px solid #1f2430;
    color: var(--bs-body-color);
    cursor: pointer;
    font-family: 'Courier New', monospace;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-color: #59c2ff;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Filter Tag Cloud */
.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.filter-tag {
    font-size: 0.8em;
    padding: 4px 10px;
    border: 1px solid #1f2430;
    color: var(--bs-body-color);
    background: var(--bs-body-bg);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-tag:hover, .filter-tag.active {
    border-color: #59c2ff;
    color: #59c2ff;
}

/* Ordered List Styles */
.writeup-content ol {
    margin: 15px 0;
    padding-left: 25px;
}

.writeup-content ol li {
    margin-bottom: 8px;
    list-style-type: decimal;
}

/* Image Styles */
.writeup-content img {
    border: 1px solid #1f2430;
    margin: 15px 0;
    display: block;
}

/* Link Styles */
.writeup-content a {
    color: #59c2ff;
    text-decoration: none;
    border-bottom: 1px dashed #2d333b;
    transition: all 0.2s;
}

.writeup-content a:hover {
    color: #73d0ff;
    border-bottom-color: #59c2ff;
}

/* Inline Code Styles */
.writeup-content code {
    background: #161b22;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    color: #73d0ff;
    border: 1px solid #1f2430;
    overflow-wrap: break-word;
}

/* Pre block code overrides */
.writeup-content pre code {
    background: transparent;
    padding: 0;
    border: none;
    font-size: 1em;
    color: var(--bs-body-color);
}


.file-browser {
    font-family: 'Courier New', monospace;
    color: var(--bs-body-color);
}
.file-browser,
.file-browser ul {
    list-style: none;
    padding-left: 1em;
    margin: 0;
}

.folder-name {
    cursor: pointer;
    font-weight: bold;
}

.files {
    display: none;
    margin-left: 1em;
}

.folder.open > .files {
    display: block;
}

blockquote {
    padding-left: 10px;
    border-left: 1px dotted #666;
}

.flash-alert {
    background-color: #c0392b; /* red box */
    color: #ffffff;
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 4px;
    position: relative;
    font-weight: 500;

    /* animation */
    animation: fadeOut 1s ease-in-out forwards;
    animation-delay: 5s;
}

/* Close button */
.flash-alert .close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
}

/* Fade + collapse */
@keyframes fadeOut {
    from {
        opacity: 1;
        max-height: 200px;
        margin-bottom: 10px;
    }
    to {
        opacity: 0;
        max-height: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}

.logo {
    width:200px;
    margin:10px;
    transition: all 0.4s;
}
