/* Settings Icon Styles */
.settings-icon {
    transition: transform 0.2s ease;
}

.desktop-icon:hover .settings-icon {
    transform: scale(1.05);
}

/* Remove spin animation */
.desktop-icon:hover .settings-icon #main-gear {
    animation: none;
}

/* Settings Modal */
.settings-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 900px;
    height: 600px;
    background: rgba(28, 28, 28, 0.95);
    border-radius: 10px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    overflow: hidden;
}

.settings-modal.show {
    display: flex;
    flex-direction: column;
    animation: modalFadeIn 0.3s ease-out;
}

.settings-content {
    display: flex;
    height: calc(100% - 40px);
}

.settings-sidebar {
    width: 250px;
    background: rgba(40, 40, 40, 0.5);
    border-right: 1px solid rgba(255,255,255,0.1);
    padding: 20px;
}

.search-box {
    background: rgba(60, 60, 60, 0.5);
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.search-box input {
    background: none;
    border: none;
    color: white;
    margin-left: 8px;
    width: 100%;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-box input:focus {
    outline: none;
}

.settings-categories .category {
    display: flex;
    align-items: center;
    padding: 10px;
    margin: 2px 0;
    border-radius: 6px;
    cursor: pointer;
    color: white;
    transition: background-color 0.2s ease;
}

.settings-categories .category:hover {
    background: rgba(255,255,255,0.1);
}

.settings-categories .category.active {
    background: rgba(255,255,255,0.2);
}

.settings-categories .category i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.settings-main {
    flex: 1;
    padding: 20px;
    color: white;
    overflow-y: auto;
}

/* Window Controls */
.window-header {
    display: flex;
    align-items: center;
    padding: 8px;
    
}

.window-buttons {
    display: flex;
    gap: 8px;
    margin-right: 16px;
}

.close-btn,
.minimize-btn,
.maximize-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
}

.close-btn {
    position: absolute;
    top: 15px;
    left: 25px;
    width: 12px;
    height: 12px;
    background: #FF5F56;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
    border: none;
    padding: 0;
}

.close-btn:hover {
    background: #FF5F56;
    opacity: 0.8;
}

.close-btn::after,
.close-btn::before {
    display: none;
}

.minimize-btn {
    background: #FEBC2E;
}

.maximize-btn {
    background: #28C840;
}

.window-title {
    color: white;
    font-size: 14px;
    flex-grow: 1;
    text-align: center;
}

/* Settings Content Styles */
.settings-section {
    margin-bottom: 30px;
}

.settings-section h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: white;
}

.settings-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: rgba(60, 60, 60, 0.5);
    border-radius: 6px;
    margin-bottom: 10px;
}

.settings-option label {
    color: white;
    margin: 0;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.2);
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #9f56ff;
}

input:checked + .toggle-slider:before {
    transform: translateX(16px);
}

/* Animations */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Lock Screen Styles */
.lock-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('Sonoma-2.webp');
    background-size: cover;
    background-position: center;
    display: none;
    z-index: 9999;
    cursor: pointer;
    overflow: hidden;
}

.lock-screen.show {
    display: flex;
    animation: fadeIn 0.5s ease-out;
}

.lock-screen-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    background: linear-gradient(to bottom, 
        rgba(0,0,0,0.1) 0%,
        rgba(0,0,0,0.2) 50%,
        rgba(0,0,0,0.4) 100%
    );
    transition: transform 0.2s ease;
}

.lock-screen-content:active {
    transform: scale(0.99);
}

.lock-time {
    font-size: 96px;
    font-weight: 200;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.lock-date {
    font-size: 32px;
    font-weight: 300;
    margin-bottom: 60px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.lock-user {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.lock-user-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.8);
    margin-bottom: 15px;
    object-fit: cover;
}

.lock-user-name {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.lock-user-hint {
    font-size: 14px;
    color: rgba(255,255,255,0.9);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.lock-message {
    position: absolute;
    bottom: 40px;
    font-size: 14px;
    color: rgba(255,255,255,0.9);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Status Bar on Lock Screen */
.status-icons {
    position: absolute;
    right: 20px;
    color: white;
    font-size: 14px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.lock-user-image:hover {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

.finder-menu-container {
    position: relative;
    display: inline-block;
}

.finder-label {
    cursor: pointer;
    padding: 5px 10px;
    -webkit-tap-highlight-color: transparent;
}

.finder-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(40, 40, 40, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 8px;
    min-width: 200px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    margin-top: 5px;
}

.finder-dropdown.show {
    display: block;
}

.finder-dropdown .menu-item {
    padding: 12px 15px;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s;
    user-select: none;
    -webkit-user-select: none;
}

.finder-dropdown .menu-item:hover,
.finder-dropdown .menu-item:active {
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    .finder-dropdown {
        position: absolute;
        left: 0;
        min-width: 160px;
        top: 100%;
    }
    
    .finder-dropdown .menu-item {
        padding: 15px 20px;
        font-size: 14px;
    }
}

.trash-contents {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.trash.full .trash-contents {
    opacity: 0.9;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 20px;
    padding: 20px;
}

.game-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
    padding: 10px;
    border-radius: 10px;
}

.game-item:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.1);
}

.game-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 8px;
}

.game-item span {
    color: white;
    font-size: 14px;
    text-align: center;
}

.folder-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(40, 40, 40, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 10px;
    z-index: 1000;
    width: 400px;
    max-width: 90vw;
    max-height: 90vh;
    display: none;
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 20px;
    justify-items: center;
    align-items: center;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .folder-modal {
        width: 95vw;
    }
    
    .social-grid {
        gap: 15px;
        padding: 15px;
    }
}

/* Desktop Icons Layout */
.desktop {
    position: fixed;
    top: 40px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    padding: 20px;
    z-index: 1;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 90px);
    justify-content: start;
    gap: 20px;
    padding: 20px;
    height: 100%;
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s;
    width: 90px;
}

.icon {
    width: 60px;
    height: 60px;
}

.desktop-icon span {
    color: white;
    font-size: 12px;
    text-align: center;
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
    word-wrap: break-word;
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .desktop {
        top: 35px;
        padding: 10px;
    }

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

    .desktop-icon {
        width: 70px;
    }
}

/* Medium small screens */
@media (max-width: 375px) {
    .icon-grid {
        grid-template-columns: repeat(auto-fill, 65px);
        gap: 12px;
        padding: 8px;
    }

    .desktop-icon {
        width: 65px;
    }

    .icon {
        width: 45px;
        height: 45px;
    }
}

/* Very small screens (iPhone SE 1st gen, etc) */
@media (max-width: 320px) {
    .icon-grid {
        grid-template-columns: repeat(auto-fill, 60px);
        gap: 10px; /* Maintain minimum gap */
        padding: 8px;
    }

    .desktop-icon {
        width: 60px;
    }

    .icon {
        width: 40px;
        height: 40px;
    }

    .desktop-icon span {
        font-size: 10px;
    }
}

/* Height-based adjustments */
@media (max-height: 600px) {
    .icon-grid {
        gap: 12px;
    }
}

@media (max-height: 450px) {
    .icon-grid {
        gap: 10px;
    }
    
    .desktop-icon span {
        -webkit-line-clamp: 1;
    }
}

/* Menu Bar and Status Icons */
.menu-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: rgba(40, 40, 40, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    padding: 0 10px;
    z-index: 1000;
    font-size: 14px;
    color: white;
}

.menu-left {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 15px;
    min-width: fit-content; /* Ensure menu items don't shrink too much */
}

.menu-right {
    display: flex;
    align-items: center;
    height: 100%;
    margin-left: auto; /* Push to the right */
    gap: 15px;
}

.status-icons {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto; /* Ensure it stays right */
    padding-right: 5px;
}

/* Dynamic gap adjustments */
@media (max-width: 480px) {
    .menu-left {
        gap: 12px;
    }
    .status-icons {
        gap: 8px;
        margin-right: -10px;
    }
}

@media (max-width: 400px) {
    .menu-left {
        gap: 10px;
    }
    .status-icons {
        gap: 4px;
        margin-right: -15px;
    }
}

@media (max-width: 350px) {
    .menu-left {
        gap: 8px;
    }
    .status-icons {
        gap: 2px;
        margin-right: -20px;
    }
}

@media (max-width: 320px) {
    .menu-bar {
        padding: 0 5px;
    }
    .menu-left {
        gap: 6px;
    }
    .status-icons {
        gap: 0px;
        margin-left: 10px;
        margin-right: -30px;
    }
}

/* Specific icon adjustments */
.status-icons .fa-sun,
.status-icons .fa-user,
.status-icons .fa-wifi,
.status-icons .fa-bluetooth-b {
    position: relative;
    top: 1px;
}

.visit-counter {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 7px 30px;
    border-radius: 8px;
    font-size: 14px;
    color: #fff;
    z-index: 1000;
}

.more-info-btn {
    display: block;
    margin: 20px auto;
    padding: 10px 25px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.more-info-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Mobile adjustments if needed */
@media (max-width: 768px) {
    .more-info-btn {
        padding: 8px 20px;
        font-size: 13px;
    }
}

.stats-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
}

.stats-modal-content {
    position: relative;
    background: rgba(40, 40, 40, 0.95);
    margin: 10% auto;
    padding: 20px;
    width: 80%;
    max-width: 600px;
    border-radius: 12px;
    color: #fff;
    max-height: 70vh; /* Limit height to 70% of viewport height */
    display: flex;
    flex-direction: column;
}

.stats-body {
    overflow-y: auto; /* Enable vertical scrolling */
    flex-grow: 1;
    margin: 15px -20px;
    padding: 0 20px;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.stats-header {
    position: sticky;
    top: 0;
    background: rgba(40, 40, 40, 0.95);
    padding: 10px 0;
    z-index: 1;
}

.stats-table thead {
    position: sticky;
    top: 0;
    background: rgba(40, 40, 40, 0.95);
    z-index: 1;
}

/* Custom scrollbar for better appearance */
.stats-body::-webkit-scrollbar {
    width: 8px;
}

.stats-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.stats-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.stats-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-stats {
    font-size: 24px;
    cursor: pointer;
    color: red;
    transition: color 0.3s ease;
}

.close-stats:hover {
    color: #ff4444; /* Lighter red on hover */
}

/* Mobile styles */
@media (max-width: 768px) {
    .close-stats {
        font-size: 20px; /* Slightly smaller on mobile */
        padding: 5px; /* Add some padding for better touch target */
    }
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.stats-table th,
.stats-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-table th {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

.country-flag {
    width: 24px;
    height: 16px;
    margin-right: 8px;
    vertical-align: middle;
}

.load-more-btn {
    display: block;
    width: auto;
    min-width: 120px;
    margin: 20px auto;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 14px;
}

.load-more-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Mobile styles */
@media (max-width: 768px) {
    .load-more-btn {
        min-width: 100px;
        padding: 6px 16px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .visit-counter {
        bottom: 80px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(40, 40, 40, 0.8);
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
        padding: 7px 30px;
        border-radius: 8px;
        text-align: center;
    }
    
    .stats-modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .more-info-btn {
        font-size: 12px;
        padding: 2px 10px;
        margin-top: 2px;
    }
}

.contact-modal-content {
    position: relative;
    background: rgba(25, 25, 25, 0.95);
    margin: 5% auto;
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    color: #fff;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 40px;
}

.profile-header {
    text-align: center;
    margin-bottom: 40px;
}

.profile-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-bottom: 20px;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.1);
}

.profile-header h2 {
    font-size: 32px;
    margin: 0 0 10px 0;
    font-weight: 500;
}

.role-title {
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    margin: 0;
}

.info-grid {
    background: rgba(40, 40, 40, 0.5);
    border-radius: 15px;
    overflow: hidden;
    margin-top: 30px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
}

.info-value {
    color: #fff;
    font-size: 18px;
    text-align: right;
}

.info-value a {
    color: #fff;
    text-decoration: none;
}

.social-links {
    display: flex;
    gap: 20px;
    justify-content: flex-end;
}

.social-links a {
    color: #fff;
    font-size: 24px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.social-links a:hover {
    opacity: 1;
}

.close-btn {
    position: absolute;
    top: 15px;
    left: 25px;
    width: 12px;
    height: 12px;
    background: #FF5F56;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
    border: none;
    padding: 0;
}

.close-btn:hover {
    background: #FF5F56;
    opacity: 0.8;
}

/* Mobile Styles - Maintaining the same layout */
@media (max-width: 768px) {
    .contact-modal-content {
        margin: 0;
        width: 100%;
        height: 100vh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 20px;
    }

    .profile-header {
        margin-bottom: 30px;
    }

    .profile-header h2 {
        font-size: 28px;
    }

    .info-row {
        padding: 15px 20px;
    }

    .info-label, 
    .info-value {
        font-size: 16px;
    }

    .social-links {
        gap: 25px;
    }

    .social-links a {
        font-size: 22px;
    }
}

.help-menu-container {
    position: relative;
    display: inline-block;
}

.help-label {
    padding: 0 10px;
    cursor: pointer;
    color: #fff;
}

.help-dropdown {
    display: none;
    position: absolute;
    top: 25px;
    background: rgba(40, 40, 40, 0.95);
    min-width: 120px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
}

/* Remove hover-based display */
.help-label:hover + .help-dropdown,
.help-dropdown:hover {
    display: none;
}

.help-label {
    padding: 0 10px;
    cursor: pointer;
    color: #fff;
}

.user-profile-image {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin-bottom: 10px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    transform: translateZ(0);
    backface-visibility: hidden;
}

