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

body {
    font-family: 'Handjet', monospace;
    background-color: #0f0f12;
    color: #ffffff;
    height: 100vh;
    width: 100vw;
    /* Allow scrolling if content gets too tall on small screens */
    overflow-x: hidden; 
    overflow-y: auto; 
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    background-color: #0f0f12;
    z-index: 0;
    top: 0;
    left: 0;
}

/* Container */
.container {
    position: relative;
    z-index: 1;
    width: 500px; /* Slightly reduced so the card fits more comfortably */
    max-width: 95%;
    margin: 20px;
    transition: width 0.5s ease;
}

/* --- Profile Card Styling --- */
.content {
    text-align: center;
    background: rgba(15, 15, 18, 0.85);
    padding: 3rem;
    border-radius: 20px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.15);
    width: 100%;
    transition: all 0.5s ease;
    display: flex; /* Added flex to help align children */
    flex-direction: column;
    align-items: center; /* Ensures everything inside is centered */
}

.pfp {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid #00ff00;
    object-fit: cover;
    margin-bottom: 1rem;
    background-color: #222;
    transition: all 0.3s ease;
}

.username {
    font-family: 'New Amsterdam', sans-serif;
    font-size: 3rem;
    letter-spacing: 2px;
    color: #00ff00;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.real-name {
    font-family: 'Handjet', monospace;
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 0.5rem;
    color: #e0e0e0;
}

.title {
    font-family: 'Handjet', monospace;
    font-size: 1.2rem;
    color: #bd93f9;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.email-link {
    display: inline-block;
    max-width: 100%;
    margin-bottom: 2rem;
    color: #bd93f9;
    font-family: 'Handjet', monospace;
    font-size: 1.1rem;
    line-height: 1.2;
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: text-shadow 0.3s ease;
}

.email-link span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.email-link:hover {
    text-shadow: 0 0 8px rgba(189, 147, 249, 0.45);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem; 
    flex-wrap: wrap;
    width: 100%; /* Ensure it spans width for centering */
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.social-links img {
    width: 60%;
    height: auto;
    object-fit: contain;
}

.social-links a:hover {
    background: rgba(0, 255, 0, 0.1);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 255, 0, 0.2);
    border: 1px solid #00ff00;
}

/* --- TryHackMe Badge Styling --- */
.thm-badge-container {
    width: 100%;
    margin-bottom: 0.5rem; /* Reduced margin */
    display: flex;
    justify-content: center; /* Crucial for centering iframe */
    align-items: center;
}

.thm-badge {
    border: none;
    display: block;
    margin: 0 auto;
    width: 360px; /* Match the badge's natural width */
    max-width: 100%; /* Keep responsive on small screens */
    height: 150px; /* Increased height slightly */
    overflow: hidden;
}

.terminal-btn {
    background: transparent;
    border: 1px solid #00ff00;
    color: #00ff00;
    padding: 10px 20px;
    font-family: 'Handjet', monospace;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px; /* Ensure space if badge is missing */
}

.terminal-btn:hover {
    background: #00ff00;
    color: #000;
    box-shadow: 0 0 15px rgba(0,255,0,0.5);
}

/* --- Terminal Window Styling --- */
.terminal-window {
    display: none; 
    background: rgba(10, 10, 10, 0.95);
    width: 100%;
    height: 450px;
    border-radius: 10px;
    border: 1px solid #333;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    font-family: 'VT323', monospace;
    flex-direction: column;
    overflow: hidden;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.terminal-header {
    background: #1a1a1a;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #333;
}

.terminal-dots {
    display: flex;
    gap: 6px;
    margin-right: 15px;
}

.dot { width: 12px; height: 12px; border-radius: 50%; cursor: pointer; }
.red { background: #ff5f56; }
.yellow { background: #ffbd2e; }
.green { background: #27c93f; }

.terminal-title {
    color: #888;
    font-size: 1rem;
    flex-grow: 1;
    text-align: center;
}

.terminal-body {
    padding: 20px;
    color: #00ff00;
    font-size: 1.2rem;
    flex-grow: 1;
    overflow-y: auto;
    text-align: left;
}

.output-line { margin-bottom: 5px; word-wrap: break-word; }
.comment { color: #666; margin-bottom: 15px; display: block; }
.input-line { display: flex; align-items: center; }
.prompt { color: #bd93f9; margin-right: 10px; white-space: nowrap; }
.cmd-input {
    background: transparent;
    border: none;
    color: #00ff00;
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    outline: none;
    flex-grow: 1;
    min-width: 0; 
}

.project-link {
    color: #50fa7b;
    text-decoration: underline;
    margin-left: 10px;
    cursor: pointer;
}
.project-link:hover { color: #fff; }

/* --- MINESWEEPER STYLES --- */
.minesweeper-view {
    display: none; 
    border: 1px solid #00ff00; 
}

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

.game-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 300px;
    margin-bottom: 15px;
    color: #00ff00;
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
}

.restart-btn {
    background: #00ff00;
    border: none;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    padding: 2px 8px;
    font-family: 'VT323', monospace;
}
.restart-btn:hover { background: #fff; }

.grid {
    display: grid;
    grid-template-columns: repeat(8, 35px); 
    grid-template-rows: repeat(8, 35px);    
    gap: 2px;
    background: #333;
    padding: 5px;
    border: 1px solid #555;
}

.cell {
    width: 35px;
    height: 35px;
    background: #444;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.1s;
}

.cell:hover { background: #555; }
.cell.revealed { background: #222; color: #fff; cursor: default; }
.cell.mine { background: #ff5f56; color: #000; }
.cell.flag { color: #ffbd2e; }

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 600px) {
    .content {
        padding: 2rem 1.5rem;
        width: 100%; 
    }

    .pfp {
        width: 100px;
        height: 100px;
    }

    .username {
        font-size: 2.2rem;
    }

    .real-name {
        font-size: 1.2rem;
    }

    .title {
        font-size: 1rem;
    }

    .email-link {
        font-size: 1rem;
    }

    .social-links {
        gap: 1rem;
    }

    .terminal-window {
        height: 60vh;
    }

    .terminal-body {
        font-size: 1rem;
        padding: 15px;
    }

    /* Adjust Minesweeper Grid for Small Screens */
    .grid {
        grid-template-columns: repeat(8, 30px);
        grid-template-rows: repeat(8, 30px);
    }
    .cell {
        width: 30px;
        height: 30px;
    }
}
