/* Windows 3.1 Style CSS */

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

body {
    font-family: "MS Sans Serif", Arial, sans-serif;
    font-size: 11px;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    cursor: default;
    user-select: none;
}

/* Desktop Background */
.desktop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #008080;
    z-index: 0;
}

.desktop-pattern {
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(0, 0, 0, 0.1) 1px, rgba(0, 0, 0, 0.1) 2px),
        repeating-linear-gradient(90deg, transparent, transparent 1px, rgba(0, 0, 0, 0.1) 1px, rgba(0, 0, 0, 0.1) 2px);
    background-size: 2px 2px;
}

/* Windows Container */
#windows-container {
    position: relative;
    width: 100%;
    height: calc(100% - 30px);
    z-index: 1;
}

/* Window Styling */
.window {
    position: absolute;
    background-color: #C0C0C0;
    border: 2px solid;
    border-top-color: #DFDFDF;
    border-left-color: #DFDFDF;
    border-right-color: #404040;
    border-bottom-color: #404040;
    box-shadow: 1px 1px 0 #000;
    min-width: 200px;
    min-height: 100px;
}

.window.active .window-header {
    background: linear-gradient(90deg, #000080, #1084D0);
    color: white;
}

.window:not(.active) .window-header {
    background: linear-gradient(90deg, #808080, #A0A0A0);
    color: #C0C0C0;
}

.window-header {
    height: 18px;
    padding: 2px;
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 11px;
    cursor: move;
    position: relative;
}

.window-control-btn {
    width: 16px;
    height: 14px;
    margin-right: 2px;
    background-color: #C0C0C0;
    border: 1px solid;
    border-top-color: #DFDFDF;
    border-left-color: #DFDFDF;
    border-right-color: #404040;
    border-bottom-color: #404040;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.control-icon {
    width: 10px;
    height: 2px;
    background-color: #000;
    border: 1px solid #000;
    display: block;
}

.window-title {
    flex: 1;
    text-align: center;
    letter-spacing: 0.5px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: 0 4px;
}

.window-buttons {
    display: flex;
    gap: 2px;
}

.window-btn {
    width: 16px;
    height: 14px;
    background-color: #C0C0C0;
    border: 1px solid;
    border-top-color: #DFDFDF;
    border-left-color: #DFDFDF;
    border-right-color: #404040;
    border-bottom-color: #404040;
    cursor: pointer;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    padding: 0;
    line-height: 1;
}

.window-btn:active {
    border-top-color: #404040;
    border-left-color: #404040;
    border-right-color: #DFDFDF;
    border-bottom-color: #DFDFDF;
    padding-left: 1px;
    padding-top: 1px;
}

.window-content {
    background-color: #FFF;
    height: calc(100% - 18px);
    overflow: auto;
    padding: 8px;
}

/* Icon Grid Layout */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 80px);
    grid-auto-rows: minmax(70px, auto);
    gap: 8px;
    padding: 8px;
    align-items: start;
}

/* Icon Styling */
.icon {
    width: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    cursor: pointer;
    padding: 4px;
    outline: none;
    height: 100%;
}

.icon:focus {
    border: 1px dotted #000;
    background-color: #000080;
    /* Optional: Auto-select on focus for better visibility */
}

.icon:focus .icon-label {
    color: white;
    /* Make text readable on dark background */
}

.icon.selected {
    background-color: #000080;
}

.icon.selected .icon-label {
    color: white;
}

.icon-image {
    width: 32px;
    height: 32px;
    background-color: #C0C0C0;
    border: 1px solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

/* Folder Icon */
.icon-image.folder {
    background: linear-gradient(180deg, #FFFF00 0%, #FFCC00 100%);
    border-top-left-radius: 3px;
    border-bottom-right-radius: 2px;
    border-bottom-left-radius: 2px;
}

.icon-image.folder::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 2px;
    width: 10px;
    height: 4px;
    background: linear-gradient(180deg, #FFFF00 0%, #FFCC00 100%);
    border: 1px solid #000;
    border-bottom: none;
    border-top-left-radius: 2px;
    border-top-right-radius: 2px;
}

/* Control Panel Icon */
.icon-image.control-panel {
    background: linear-gradient(135deg, #0080FF 0%, #0040A0 100%);
}

.icon-image.control-panel::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 3px;
    background: repeating-linear-gradient(90deg, #FF0000, #FF0000 2px, #00FF00 2px, #00FF00 4px, #0000FF 4px, #0000FF 6px);
    top: 8px;
}

.icon-image.control-panel::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 3px;
    background: repeating-linear-gradient(90deg, #FFFF00, #FFFF00 2px, #FF00FF 2px, #FF00FF 4px, #00FFFF 4px, #00FFFF 6px);
    top: 18px;
}

/* File Manager Icon */
.icon-image.file-manager {
    background: linear-gradient(180deg, #808080 0%, #606060 100%);
}

.icon-image.file-manager::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 12px;
    background: #FFFF00;
    border: 1px solid #000;
    top: 8px;
    border-radius: 1px;
}

.icon-image.file-manager::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 2px;
    background: #000;
    top: 14px;
}

/* Command Prompt Icon */
.icon-image.command-prompt {
    background: #000;
}

.icon-image.command-prompt::before {
    content: 'C:\\>';
    color: #FFF;
    font-family: 'Courier New', monospace;
    font-size: 8px;
    font-weight: bold;
}

/* Read Me Icon */
.icon-image.readme {
    background: #FFF;
}

.icon-image.readme::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 6px;
    width: 18px;
    height: 2px;
    background: #000;
    box-shadow:
        0 4px 0 #000,
        0 8px 0 #000,
        0 12px 0 #000,
        0 16px 0 #000;
}

.icon-image.readme::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 8px 8px 0;
    border-color: transparent #C0C0C0 transparent transparent;
}

/* System Info Icon */
.icon-image.system-info {
    background: linear-gradient(135deg, #0080FF 0%, #0040A0 100%);
    border-radius: 50%;
}

.icon-image.system-info::before {
    content: 'i';
    color: #FFF;
    font-size: 24px;
    font-weight: bold;
    font-family: 'Times New Roman', serif;
    font-style: italic;
}

.icon-label {
    text-align: center;
    font-size: 11px;
    word-wrap: break-word;
    max-width: 64px;
    line-height: 1.2;
    white-space: normal;
}

/* Minimized Windows Tray */
.minimized-tray {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background-color: #C0C0C0;
    border-top: 2px solid;
    border-top-color: #DFDFDF;
    display: flex;
    align-items: center;
    padding: 2px;
    gap: 4px;
    z-index: 1000;
}

.minimized-window {
    height: 24px;
    padding: 0 8px;
    background-color: #C0C0C0;
    border: 2px solid;
    border-top-color: #DFDFDF;
    border-left-color: #DFDFDF;
    border-right-color: #404040;
    border-bottom-color: #404040;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 11px;
    max-width: 150px;
    font-family: inherit;
    color: inherit;
    outline-offset: -2px;
}

.minimized-window:active {
    border-top-color: #404040;
    border-left-color: #404040;
    border-right-color: #DFDFDF;
    border-bottom-color: #DFDFDF;
}

/* Maximized Window */
.window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(100% - 30px) !important;
    border: none;
}

.window.minimized {
    display: none;
}

/* Minesweeper Icon */
.icon-image.minesweeper {
    background: #C0C0C0;
    border: 1px solid #000;
}

.icon-image.minesweeper::before {
    content: '💣';
    font-size: 20px;
}

/* Netscape Icon */
.icon-image.netscape {
    background-image: url('images/netscape.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
}

/* Cardfile Icon */
.icon-image.cardfile {
    background-image: url('images/cardfile.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
}

/* Netscape Icon */
.icon-image.netscape {
    background-image: url('images/netscape.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
}

/* Cardfile Icon */
.icon-image.cardfile {
    background-image: url('images/cardfile.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
}

/* Minesweeper Game Styling */
.minesweeper-game {
    padding: 8px;
    background-color: #C0C0C0;
}

.game-header {
    margin-bottom: 8px;
    padding: 4px;
    border: 2px solid;
    border-top-color: #808080;
    border-left-color: #808080;
    border-right-color: #DFDFDF;
    border-bottom-color: #DFDFDF;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    background-color: #C0C0C0;
}

.mine-counter,
.timer-counter {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    color: #FF0000;
    background-color: #000;
    padding: 2px 6px;
    border: 1px solid #808080;
}

.reset-btn {
    width: 26px;
    height: 26px;
    background-color: #C0C0C0;
    border: 2px solid;
    border-top-color: #DFDFDF;
    border-left-color: #DFDFDF;
    border-right-color: #404040;
    border-bottom-color: #404040;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.reset-btn:active {
    border-top-color: #404040;
    border-left-color: #404040;
    border-right-color: #DFDFDF;
    border-bottom-color: #DFDFDF;
}

.mine-cell {
    width: 20px;
    height: 20px;
    background-color: #C0C0C0;
    border: 2px solid;
    border-top-color: #DFDFDF;
    border-left-color: #DFDFDF;
    border-right-color: #808080;
    border-bottom-color: #808080;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-family: Arial, sans-serif;
    user-select: none;
}

.mine-cell:active {
    border-width: 1px;
}

/* Desktop icon selection */
.desktop .icon.selected {
    background-color: #000080;
}

.desktop .icon.selected .icon-label {
    color: white;
}

/* System Info Dialog Styling */
.system-info-dialog {
    background-color: #C0C0C0;
    border: 2px solid;
    border-top-color: #DFDFDF;
    border-left-color: #DFDFDF;
    border-right-color: #404040;
    border-bottom-color: #404040;
}

.system-info-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid #808080;
}

.system-info-icon {
    font-size: 32px;
}

.system-info-title {
    font-weight: bold;
    font-size: 14px;
}

.system-info-content {
    padding: 16px;
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
    background-color: #FFF;
}

.system-info-text {
    font-family: "MS Sans Serif", Arial, sans-serif;
    font-size: 11px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.system-info-footer {
    padding: 12px;
    display: flex;
    justify-content: center;
    border-top: 1px solid #DFDFDF;
}

.system-info-btn {
    min-width: 75px;
    padding: 4px 12px;
    background-color: #C0C0C0;
    border: 2px solid;
    border-top-color: #DFDFDF;
    border-left-color: #DFDFDF;
    border-right-color: #404040;
    border-bottom-color: #404040;
    cursor: pointer;
    font-family: "MS Sans Serif", Arial, sans-serif;
    font-size: 11px;
    font-weight: bold;
}

.system-info-btn:active {
    border-top-color: #404040;
    border-left-color: #404040;
    border-right-color: #DFDFDF;
    border-bottom-color: #DFDFDF;
}

/* Privacy Policy Window Styling */
.privacy-content {
    background-color: #FFF;
    color: #000;
    padding: 20px;
    height: 100%;
    overflow-y: auto;
    font-family: "MS Sans Serif", Arial, sans-serif;
    line-height: 1.5;
}

.privacy-content h1 {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    border-bottom: 2px solid #000;
    padding-bottom: 5px;
}

.privacy-content h2 {
    font-size: 14px;
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 10px;
}

.privacy-content h3 {
    font-size: 12px;
    font-weight: bold;
    margin-top: 15px;
    margin-bottom: 5px;
}

.privacy-content p {
    margin-bottom: 15px;
}

.privacy-content ul {
    margin-bottom: 15px;
    padding-left: 20px;
    list-style-type: square;
}

.privacy-content li {
    margin-bottom: 5px;
}


/* Control Panel Styling */
.control-panel-container {
    padding: 12px;
    background-color: #FFF;
}

/* Command Prompt Contact Form Styling */
.cmd-prompt-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #000;
}

.cmd-screen {
    flex: 1;
    background-color: #000;
    color: #FFF;
    font-family: "Courier New", monospace;
    font-size: 14px;
    padding: 12px;
    overflow-y: auto;
}

.cmd-output {
    white-space: pre-wrap;
    margin-bottom: 8px;
}

.cmd-input-line {
    display: flex;
    gap: 4px;
    align-items: center;
}

.cmd-prompt {
    color: #FFF;
}

.cmd-input {
    flex: 1;
    background-color: transparent;
    border: none;
    outline: none;
    color: #FFF;
    font-family: "Courier New", monospace;
    font-size: 14px;
    caret-color: #FFF;
}

.cmd-turnstile-area {
    padding: 12px;
    background-color: #C0C0C0;
    border-top: 2px solid #808080;
    display: flex;
    justify-content: center;
}

/* Turnstile widget container */
.contact-form-container {
    padding: 12px;
    background-color: #C0C0C0;
}

.contact-form h3 {
    font-size: 14px;
    font-weight: bold;
    color: #000;
}

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

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: bold;
    font-size: 11px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 4px;
    border: 2px solid;
    border-top-color: #808080;
    border-left-color: #808080;
    border-right-color: #DFDFDF;
    border-bottom-color: #DFDFDF;
    background-color: #FFF;
    font-family: "MS Sans Serif", Arial, sans-serif;
    font-size: 11px;
    box-sizing: border-box;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group textarea:focus {
    outline: 1px dotted #000;
    outline-offset: -3px;
}

.form-group input.invalid {
    border-top-color: #FF0000;
    border-left-color: #FF0000;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.error-message {
    color: #FF0000;
    font-size: 10px;
    margin-top: 2px;
    display: none;
}

.submit-btn {
    min-width: 100px;
    padding: 4px 16px;
    background-color: #C0C0C0;
    border: 2px solid;
    border-top-color: #DFDFDF;
    border-left-color: #DFDFDF;
    border-right-color: #404040;
    border-bottom-color: #404040;
    cursor: pointer;
    font-family: "MS Sans Serif", Arial, sans-serif;
    font-size: 11px;
    font-weight: bold;
}

.submit-btn:hover:not(:disabled) {
    background-color: #D0D0D0;
}

.submit-btn:active:not(:disabled) {
    border-top-color: #404040;
    border-left-color: #404040;
    border-right-color: #DFDFDF;
    border-bottom-color: #DFDFDF;
    padding-left: 17px;
    padding-top: 5px;
    padding-right: 15px;
    padding-bottom: 3px;
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-message {
    margin-top: 12px;
    padding: 8px;
    border: 1px solid;
    display: none;
    font-size: 11px;
}

.form-message.success {
    display: block;
    background-color: #DFF0D8;
    border-color: #3C763D;
    color: #3C763D;
}

.form-message.error {
    display: block;
    background-color: #F2DEDE;
    border-color: #A94442;
    color: #A94442;
}

/* Turnstile widget container */
#turnstile-widget {
    margin: 8px 0;
}

/* Modal Dialog Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-box {
    position: absolute;
    background-color: #C0C0C0;
    border: 2px solid;
    border-top-color: #DFDFDF;
    border-left-color: #DFDFDF;
    border-right-color: #404040;
    border-bottom-color: #404040;
    box-shadow: 2px 2px 0 #000;
    min-width: 300px;
    max-width: 500px;
}

.message-box-header {
    height: 18px;
    background: linear-gradient(90deg, #000080, #1084D0);
    color: white;
    padding: 2px 4px;
    font-weight: bold;
    font-size: 11px;
    display: flex;
    align-items: center;
}

.message-box-title {
    flex: 1;
}

.message-box-content {
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.message-box-icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}

.message-box-text {
    flex: 1;
    font-size: 11px;
    line-height: 1.4;
    padding-top: 4px;
}

.message-box-buttons {
    padding: 8px 16px 16px;
    display: flex;
    gap: 8px;
    justify-content: center;
}

.message-box-btn {
    min-width: 75px;
    padding: 4px 12px;
    background-color: #C0C0C0;
    border: 2px solid;
    border-top-color: #DFDFDF;
    border-left-color: #DFDFDF;
    border-right-color: #404040;
    border-bottom-color: #404040;
    cursor: pointer;
    font-family: "MS Sans Serif", Arial, sans-serif;
    font-size: 11px;
    font-weight: bold;
}

.message-box-btn:hover {
    background-color: #D0D0D0;
}

.message-box-btn:active {
    border-top-color: #404040;
    border-left-color: #404040;
    border-right-color: #DFDFDF;
    border-bottom-color: #DFDFDF;
    padding-left: 13px;
    padding-top: 5px;
    padding-right: 11px;
    padding-bottom: 3px;
}

.message-box-btn:focus {
    outline: 1px dotted #000;
    outline-offset: -4px;
}

/* Notepad Styling */
.notepad-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #C0C0C0;
}

.notepad-menubar {
    display: flex;
    gap: 8px;
    padding: 2px 4px;
    background-color: #C0C0C0;
    border-bottom: 1px solid #808080;
    font-size: 11px;
}

.notepad-menu {
    padding: 2px 8px;
    cursor: default;
    user-select: none;
}

.notepad-menu:hover {
    background-color: #000080;
    color: white;
}

.notepad-content {
    flex: 1;
    width: 100%;
    padding: 8px;
    border: none;
    background-color: #FFF;
    font-family: "Courier New", monospace;
    font-size: 12px;
    line-height: 1.5;
    resize: none;
    overflow-y: auto;
    box-sizing: border-box;
}

.notepad-content:focus {
    outline: none;
}

.notepad-content[readonly] {
    cursor: default;
}

/* Batch File Icon (Clicky) */
.icon-image.batch-file {
    background-color: #FFF;
    position: relative;
    border: 1px solid #808080;
    box-shadow: 1px 1px 0 #000;
}

.icon-image.batch-file::before {
    content: '⚙️';
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 16px;
    line-height: 1;
}

.icon-image.batch-file::after {
    content: '⚙️';
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 14px;
    line-height: 1;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) and (orientation: portrait) {
    .window {
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 60px);
    }

    .icon-grid {
        grid-template-columns: repeat(auto-fill, 70px);
        grid-auto-rows: 60px;
        gap: 6px;
        padding: 6px;
    }

    .minimized-tray {
        overflow-x: auto;
    }
}