/* Import Tahoma font */
@import url('https://fonts.googleapis.com/css2?family=Tahoma:wght@400;700&display=swap');

/* Reset default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body styling */
body {
    font-family: 'Tahoma', sans-serif;
    font-size: 11px;
    background: linear-gradient(to bottom, #245edd 0%, #1041a3 100%); /* Fallback */
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
    margin: 0;
}

/* Desktop background */
.desktop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 40px);
    background-image: url('/images/trumpwebback.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 40px;
    z-index: 1;
    background-color: #245edd; /* Fallback color */
}

/* Desktop icons */
.icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 160px;
    color: #FFFFFF;
    font-size: 12px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

.icon img {
    width: 128px;
    height: 128px;
    margin-bottom: 8px;
}

.icon:hover {
    background: rgba(255, 255, 255, 0.2);
    border: 1px dotted #FFFFFF;
}

/* Floating image */
.floating-image {
    position: absolute;
    width: 160px;
    height: 160px;
    z-index: 500; /* Below windows (z-index: 1000) but above desktop (z-index: 1) */
    transition: all 0.5s ease;
}

/* Taskbar */
.xp-taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, #245edd 0%, #1941c4 50%, #0f3b9c 100%);
    border-top: 1px solid #4a90e2;
    display: flex;
    align-items: center;
    padding: 0 6px;
    z-index: 1001;
}

.start-button {
    height: 32px;
    background: linear-gradient(to bottom, #73bc4b 0%, #5aa02c 50%, #4a8a1f 100%);
    border: 1px outset #5aa02c;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    font-size: 14px;
    padding: 0 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    margin-right: 8px;
}

.start-button:active {
    border: 1px inset #5aa02c;
}

.taskbar-windows {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-grow: 1;
}

.window-button {
    height: 32px;
    min-width: 160px;
    background: linear-gradient(to bottom, #e8f0fe 0%, #d1e2fd 50%, #b4d3fc 100%);
    border: 1px inset #a7bfe8;
    color: black;
    font-size: 12px;
    padding: 0 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    margin-right: 2px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.window-button.hidden {
    display: none;
}

.system-tray {
    margin-left: auto;
    display: flex;
    align-items: center;
    height: 32px;
    background: linear-gradient(to bottom, #c3d2f0 0%, #a7bfe8 50%, #8eb4e3 100%);
    border: 1px inset #a7bfe8;
    padding: 0 8px;
    font-size: 12px;
    color: black;
}

/* XP Window */
.xp-window {
    position: fixed;
    width: 900px;
    height: 650px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ece9d8;
    border: 2px outset #ece9d8;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
}

#epten-files-window, #photos-window {
    width: 1200px;
    height: 900px;
}

.xp-window.dragging {
    position: absolute;
    transform: none;
}

.xp-window.hidden {
    display: none;
}

.xp-header {
    height: 30px;
    background: linear-gradient(to bottom, #4a90e2 0%, #2e5bb8 50%, #1941a0 100%);
    border-bottom: 1px solid #1941a0;
    display: flex;
    align-items: center;
    padding: 0 8px;
    cursor: move;
    user-select: none;
}

.xp-icon {
    width: 16px;
    height: 16px;
    background: #ff3b30;
    margin-right: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 10px;
}

.xp-title {
    color: white;
    font-weight: bold;
    font-size: 11px;
    flex-grow: 1;
}

.xp-controls {
    display: flex;
    gap: 2px;
}

.xp-btn {
    width: 21px;
    height: 21px;
    background: linear-gradient(to bottom, #c3d2f0 0%, #a7bfe8 50%, #8eb4e3 100%);
    border: 1px outset #a7bfe8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: black;
}

.xp-btn:active {
    border: 1px inset #a7bfe8;
}

.xp-close {
    background: linear-gradient(to bottom, #ff6b6b 0%, #ee5a52 50%, #dc3545 100%);
    color: white;
}

.xp-content {
    flex-grow: 1;
    overflow: hidden;
    background: #121212;
}

/* Epten Files and Photos Content */
#epten-files-window .xp-content, #photos-window .xp-content {
    background: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Trumpify Content */
:root {
    --main-bg: #121212;
    --side-nav-bg: #000000;
    --card-bg: #181818;
    --card-hover-bg: #282828;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent-color: #FF3B30;
    --button-color: #1DB954;
}

.container {
    display: flex;
    height: 100%;
    background-color: var(--main-bg);
    color: var(--text-primary);
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.sidebar {
    width: 240px;
    background-color: var(--side-nav-bg);
    padding: 24px 16px;
    overflow-y: auto;
    flex-shrink: 0;
}

.logo {
    margin-bottom: 24px;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: bold;
}

.nav-menu {
    margin-bottom: 24px;
}

.nav-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-menu li {
    margin-bottom: 16px;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    transition: color 0.2s;
    font-size: 14px;
}

.nav-menu a:hover {
    color: var(--text-primary);
}

.nav-menu a.active {
    color: var(--text-primary);
}

.nav-menu i {
    margin-right: 16px;
    font-size: 20px;
}

.playlists {
    margin-top: 24px;
}

.playlists h3 {
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.playlist-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.playlist-list li {
    margin-bottom: 16px;
}

.playlist-list a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.playlist-list a:hover {
    color: var(--text-primary);
}

.main-content {
    flex-grow: 1;
    padding: 24px;
    overflow-y: auto;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.navigation-buttons {
    display: flex;
    gap: 16px;
}

.nav-btn {
    background-color: rgba(0, 0, 0, 0.7);
    color: var(--text-primary);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.section-title {
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: bold;
}

.card-grid {
    display: flex;
    justify-content: space-evenly;
    gap: 40px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.card {
    background-color: var(--card-bg);
    border-radius: 6px;
    padding: 16px;
    transition: background-color 0.3s;
    cursor: pointer;
    position: relative;
    width: 180px;
    flex: 0 0 180px;
}

.card:hover {
    background-color: var(--card-hover-bg);
}

.card-image {
    width: 100%;
    height: 148px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 16px;
}

.card:hover .play-button {
    opacity: 1;
    transform: translateY(0);
}

.play-button {
    position: absolute;
    bottom: 24px;
    right: 24px;
    background-color: var(--button-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.3s;
    color: black;
    border: none;
    cursor: pointer;
}

.card-title {
    font-weight: 700;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-description {
    color: var(--text-secondary);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.now-playing-bar {
    height: 90px;
    background-color: #181818;
    border-top: 1px solid #282828;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    flex-shrink: 0;
}

.now-playing-left {
    display: flex;
    align-items: center;
    width: 30%;
}

.now-playing-image {
    width: 56px;
    height: 56px;
    margin-right: 14px;
    object-fit: cover;
    border-radius: 4px;
}

.now-playing-info {
    display: flex;
    flex-direction: column;
}

.now-playing-song {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.now-playing-artist {
    font-size: 12px;
    color: var(--text-secondary);
}

.now-playing-center {
    flex-grow: 1;
    max-width: 40%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.player-controls {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.control-button {
    background: none;
    border: none;
    color: var(--text-secondary);
    margin: 0 8px;
    cursor: pointer;
}

.control-button:hover {
    color: var(--text-primary);
}

.control-button.play-pause {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--text-primary);
    color: black;
    display: flex;
    justify-content: center;
    align-items: center;
}

.progress-bar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.progress-time {
    font-size: 11px;
    color: var(--text-secondary);
    min-width: 40px;
}

.progress-track {
    flex-grow: 1;
    height: 4px;
    background-color: #535353;
    border-radius: 2px;
    margin: 0 8px;
    cursor: pointer;
    position: relative;
}

.progress-track-inner {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background-color: var(--text-secondary);
    border-radius: 2px;
}

.progress-track:hover .progress-track-inner {
    background-color: var(--button-color);
}

.now-playing-right {
    width: 30%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.extra-controls {
    display: flex;
    align-items: center;
}

.extra-controls button {
    background: none;
    border: none;
    color: var(--text-secondary);
    margin-left: 16px;
    cursor: pointer;
}

.extra-controls button:hover {
    color: var(--text-primary);
}

.volume-control {
    display: flex;
    align-items: center;
}

.volume-track {
    width: 93px;
    height: 4px;
    background-color: #535353;
    border-radius: 2px;
    margin-left: 8px;
    cursor: pointer;
    position: relative;
}

.volume-track-inner {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 70%;
    background-color: var(--text-secondary);
    border-radius: 2px;
}

.volume-track:hover .volume-track-inner {
    background-color: var(--button-color);
}

.search-section {
    margin-bottom: 20px;
}

.search-section input {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: none;
    background-color: #282828;
    color: var(--text-primary);
    font-size: 14px;
}

.search-section input::placeholder {
    color: var(--text-secondary);
}

.hidden {
    display: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 16px;
}

::-webkit-scrollbar-track {
    background: #282828;
}

::-webkit-scrollbar-thumb {
    background: #535353;
}

::-webkit-scrollbar-thumb:hover {
    background: #b3b3b3;
}

/* Font Awesome Icons */
.fas, .far {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

.far {
    font-weight: 400;
}

/* Media Queries */
@media (max-width: 1200px) {
    .xp-window {
        width: 700px;
        height: 500px;
    }
    #epten-files-window, #photos-window {
        width: 900px;
        height: 675px;
    }
    .sidebar {
        width: 200px;
    }
    .card-grid {
        gap: 30px;
    }
    .card {
        width: 160px;
        flex: 0 0 160px;
    }
    .card-image {
        height: 130px;
    }
}

@media (max-width: 768px) {
    .xp-window {
        width: 90vw;
        height: 80vh;
        min-width: 400px;
        min-height: 300px;
    }
    #epten-files-window, #photos-window {
        width: 90vw;
        height: 80vh;
        min-width: 400px;
        min-height: 300px;
    }
    .sidebar {
        width: 100%;
        padding: 16px;
    }
    .container {
        flex-direction: column;
    }
    .main-content {
        padding: 16px;
    }
    .card-grid {
        gap: 20px;
    }
    .card {
        width: 140px;
        flex: 0 0 140px;
    }
    .card-image {
        height: 110px;
    }
    .now-playing-bar {
        padding: 0 8px;
    }
    .now-playing-left, .now-playing-right {
        width: 40%;
    }
    .now-playing-center {
        max-width: 100%;
    }
    .xp-taskbar {
        height: 36px;
    }
    .start-button {
        height: 28px;
        font-size: 12px;
        padding: 0 10px;
    }
    .window-button {
        height: 28px;
        min-width: 140px;
        font-size: 11px;
    }
    .system-tray {
        height: 28px;
        font-size: 11px;
        padding: 0 6px;
    }
    .desktop {
        height: calc(100% - 36px);
    }
    .icon img {
        width: 96px;
        height: 96px;
    }
    .icon {
        width: 120px;
    }
    .floating-image {
        width: 120px;
        height: 120px;
    }
}