@import url('https://fonts.googleapis.com/css2?family=Architects+Daughter&family=Gloria+Hallelujah&display=swap');

:root {
    --bg-primary: #f0f4f8;
    --text-primary: #333333;
    --window-border: #333333;
    --window-highlight: #ffffff;
    --window-title: #333333;
    --taskbar-bg: #ffffff;
    
    /* Sketchy Theme Variables */
    --sketchy-bg: #ffffff;
    --sketchy-text: #333333;
    --window-soft-border: #333333;
    --accent-sketch: #333333;
    --soft-shadow: rgba(0, 0, 0, 0.2);
}

* {
    box-sizing: border-box;
    font-family: 'Architects Daughter', cursive;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 16px;
    cursor: default;
    user-select: none;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3z' fill='%239C92AC' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
}

.desktop {
    position: relative;
    width: 100%;
    height: calc(100% - 60px);
    overflow: hidden;
    padding: 20px;
}

.window {
    position: absolute;
    background-color: var(--window-highlight);
    border: 3px solid var(--window-border);
    box-shadow: 4px 4px 0 var(--soft-shadow);
    resize: both;
    overflow: hidden;
    display: none;
    flex-direction: column;
    width: 500px;
    min-width: 300px;
    min-height: 400px;
    max-width: calc(100% - 20px);
    max-height: calc(100% - 50px);
    border-radius: 8px;
    transform: rotate(var(--rotation));
    --rotation: calc(random() * 1deg - 0.5deg);
    filter: url(#rough);
}

.window::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    z-index: -1;
    background: transparent;
    border: 2px solid var(--window-border);
    border-radius: 12px;
    transform: rotate(-0.5deg);
}

.window-title {
    cursor: move; /* Indicate movability */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: none; /* Disable default touch interactions */
    color: #fff;
    background: var(--window-title);
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Gloria Hallelujah', cursive;
    transform: rotate(-0.5deg);
}

.window-content {
    flex-grow: 1;
    overflow-x: hidden;
    /* padding: 15px; */
    overflow-y: auto; /* Allow scrolling */
    flex-grow: 1;
    max-height: calc(100% - 50px); /* Ensure content fits */
    background-color: var(--dreamy-bg);
    color: var(--dreamy-text);
    font-family: 'VT323', monospace;
    border: 2px solid var(--window-soft-border);
    box-shadow: 3px 3px 10px var(--soft-shadow);
    height: 100%;
    width: 100%;
}

iframe {
    width: 100%;
    height: 100%;
    min-height: inherit;
}

/* Scrollbar Styling */
.window-content::-webkit-scrollbar {
    width: 8px;
}

.window-content::-webkit-scrollbar-track {
    background: var(--dreamy-bg);
}

.window-content::-webkit-scrollbar-thumb {
    background: var(--accent-purple);
    border-radius: 4px;
}

/* Responsive Grid Layouts */
.system-stats, 
.tool-grid, 
.app-categories, 
.featured-apps, 
.transaction-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

/* Window-specific Refinements */
#vwoksys-window .system-stats p,
.contact {
    background-color: rgba(106, 90, 205, 0.05);
    border-left: 3px solid var(--accent-purple);
    padding: 8px;
    margin: 5px 0;
}

.app-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(230, 230, 250, 0.7);
    border: 1px solid var(--window-soft-border);
    padding: 10px;
    transition: transform 0.3s ease;
}

.app-item:hover {
    transform: scale(1.02);
}

.app-item .app-icon {
    background-color: rgba(106, 90, 205, 0.2);
    color: var(--accent-purple);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Chat and Contacts Refinement */
.chat-container {
    display: grid;
    grid-template-rows: auto 1fr auto;
    height: 100%;
}

.chat-messages {
    overflow-y: auto;
    background-color: var(--sketchy-bg);
    color: var(--sketchy-text);
    border: 2px dashed var(--window-soft-border);
    padding: 15px;
    position: relative;
}

.window-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7z' fill='%23333' fill-opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
}

.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: var(--taskbar-bg);
    border-top: 3px solid var(--window-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    filter: url(#rough);
}

.start-button {
    gap: 5px;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    padding: 6px;
    border: 1px solid var(--window-border);
    border-radius: 20px;
}

.start-button img {
    height: 25px;
    width: 25px;
    border-radius: 50%;
}

.start-button span {
    font-size: 18px;
}

.start-menu {
    position: fixed;
    bottom: 70px;
    left: 20px;
    width: 300px;
    background: white;
    border: 3px solid var(--window-border);
    border-radius: 8px;
    display: none;
    z-index: 1000;
    backdrop-filter: blur(10px);
    padding: 10px;
    animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.start-menu-header {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #444;
    margin-bottom: 10px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 10px;
}

.user-name {
    color: #fff;
    font-size: 14px;
}

.user-vwoid {
    color: #413eff;
    font-size: 14px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 4px;
}

.menu-item:hover {
    background-color: #ffffff1a;
}

.logout:hover {
    background-color: #ff000044;
}

.menu-icon {
    width: 25px;
    height: 25px;
    margin-right: 10px;
}

.menu-item span {
    color: #444;
    font-size: 14px;
}

.menu-separator {
    height: 1px;
    background-color: #444;
    margin: 5px 0;
}

.system-tray {
    gap: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Modify the existing start-button style */
.start-button {
    transition: background-color 0.2s;
}

button:hover {
    transform: translate(-2px, -2px) rotate(-0.5deg);
    box-shadow: 3px 3px 0 var(--soft-shadow);
}

input {
    border: 2px solid var(--window-border);
    background: white;
    padding: 10px;
    font-family: 'Architects Daughter', cursive;
    transform: rotate(-0.3deg);
}

/* Add SVG filter for rough effect to HTML */
/* Need to add this to HTML:
<svg style="position: absolute; width: 0; height: 0;">
    <filter id="rough">
        <feTurbulence type="fractalNoise" baseFrequency="0.02" numOctaves="3" />
        <feDisplacementMap in="SourceGraphic" scale="0.5" />
    </filter>
</svg>
*/

/* Desktop Icons */
.desktop-icons {
    display: grid;
    grid-template-columns: repeat(auto-fill, 100px);
    gap: 20px;
    padding: 20px;
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.desktop-icon:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.icon-box {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    border: 2px solid var(--window-border);
    box-shadow: 2px 2px 0 var(--soft-shadow);
}

.icon-label {
    font-size: 14px;
    text-align: center;
    color: var(--text-primary);
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
}