:root {
    --bg-color: #0b0c10;       /* Deep Black/Grey Background */
    --card-bg: #1f2833;        /* Dark Grey Card Background */
    --accent-color: #66fcf1;   /* Cyan Accent */
    --accent-hover: #45a29e;   /* Darker Cyan for Hover */
    --text-primary: #ffffff;   /* White Text */
    --text-secondary: #c5c6c7; /* Light Grey Text */
    --input-bg: #0b0c10;       /* Black Input Background */
    --border-color: rgba(102, 252, 241, 0.2);
}

/* --- GLOBAL RESET --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- PARTICLE CANVAS --- */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* --- LAYOUT CONTAINERS --- */
.container {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* --- HEADER --- */
header {
    padding: 20px 0;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1rem;
    padding: 8px 16px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    transition: 0.3s;
}

.nav-link:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background: rgba(102, 252, 241, 0.1);
}

/* --- MAIN MENU (APP GRID) --- */
.menu-section {
    text-align: center;
    margin-top: 20px;
}

.menu-section h1 {
    font-size: 2.5rem;
    margin-bottom: 40px;
}

.app-grid {
    display: grid;
    /* This creates the grid layout. Adjust '200px' to change button size */
    grid-template-columns: repeat(auto-fit, minmax(200px, 220px));
    gap: 30px;
    justify-content: center;
}

.app-card {
    background-color: var(--card-bg);
    border: 2px solid transparent; /* Invisible border by default */
    border-radius: 15px;
    padding: 20px;
    text-decoration: none; /* Removes underline from links */
    color: white;
    transition: all 0.3s ease;
    
    /* Center content inside the square */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; 
    
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    cursor: pointer;
    
    /* Forces the card to be a perfect square */
    aspect-ratio: 1 / 1;
}

.app-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 0 25px rgba(102, 252, 241, 0.2);
    background-color: #252f3d;
}

.app-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(102, 252, 241, 0.5);
}

.app-info h3 {
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-bottom: 5px;
    text-align: center;
    line-height: 1.2;
}

.app-info p {
    /* Hides the description text on the main menu to keep buttons clean */
    display: none; 
}

/* --- CALCULATOR / FORM STYLES --- */
.calculator-wrapper {
    max-width: 900px;
    margin: 20px auto;
    width: 100%;
}

.page-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
    color: white;
    text-shadow: 0 0 10px rgba(102, 252, 241, 0.3);
}

.form-card {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.05);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* INPUTS & DROPDOWNS */
select, .input-text {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--input-bg);
    border: 1px solid #45a29e;
    color: white;
    font-size: 1rem;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    appearance: none; /* Removes default browser arrow */
    transition: 0.3s;
}

/* Custom Arrow for Selects */
select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366fcf1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

select:focus, .input-text:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 8px rgba(102, 252, 241, 0.3);
}

/* BUTTONS */
.btn-primary {
    width: 100%;
    padding: 15px;
    background-color: var(--accent-color);
    color: #0b0c10;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-primary:hover {
    background-color: #fff;
    box-shadow: 0 0 20px rgba(102, 252, 241, 0.6);
    transform: scale(1.02);
}

/* RESULT AREA (Graduation Calc) */
.result-box {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.result-box.hidden { display: none; }

.result-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.result-year {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

/* --- COMMAND LIBRARY PAGE STYLES --- */

.cmd-category {
    margin-bottom: 40px;
}

.cmd-category h3 {
    color: var(--accent-color);
    border-bottom: 1px solid rgba(102, 252, 241, 0.2);
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cmd-grid {
    display: grid;
    /* Responsive grid: columns will be at least 280px wide */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.cmd-card {
    background-color: #1a1a1a; /* Dark Grey background */
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    display: flex;         /* Ensures children stack vertically */
    flex-direction: column; 
}

.cmd-card:hover {
    border-color: var(--accent-color);
    background-color: #222;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.cmd-card:active {
    transform: scale(0.98);
}

.cmd-desc {
    display: block; /* Forces text to its own line */
    color: #ccc;
    font-size: 0.9rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.cmd-text {
    display: block; /* Forces code to its own line */
    background-color: #000;
    color: #00ff9d; /* Matrix Green */
    padding: 10px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    font-size: 0.85rem;
    border-left: 3px solid var(--accent-color);
    
    /* Text truncation if too long */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- TOAST NOTIFICATION (Pop up when copied) --- */
#toast {
    visibility: hidden;
    min-width: 250px;
    background-color: var(--accent-color);
    color: #000;
    text-align: center;
    border-radius: 5px;
    padding: 16px;
    position: fixed;
    z-index: 100;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-weight: bold;
    box-shadow: 0 0 20px rgba(102, 252, 241, 0.4);
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
}

#toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 50px;
}