fileexplorer {  
    display: flex;
    flex: 1;
    overflow: hidden;
}

#screen {
  display: flex;
  height: calc(100vh - 50px);
  box-sizing: border-box;
}

#screen .sidebar,
#screen .main {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#file-explorer {
    display: flex;
    flex: 1;
}

.sidebar {
    width: 200px;
    border-right: 2px solid;
    padding: 5px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

body.light-mode .sidebar {
    background: linear-gradient(180deg, 
        rgba(252, 228, 236, 0.95) 0%, 
        rgba(255, 218, 224, 0.9) 100%);
    border-right-color: #f06292;
    color: #8c1414;
}

body.dark-mode .sidebar {
    background: linear-gradient(180deg, 
        rgba(23, 27, 60, 0.95) 0%, 
        rgb(33, 35, 57) 100%);
    border-right-color: #3f51b5;
    color: #e8eaf6;
}

.sidebar ul {
    list-style-type: none;
    padding: 0;
}

/* Remove default link styling */
.sidebar a {
    text-decoration: none;
    color: inherit;
}

.sidebar li {
    margin: 8px 5px;
    padding: 5px;
    display: flex;
    align-items: center;
    border-radius: 5px;
    transition: transform 0.3s ease, border 0.3s ease;
    cursor: pointer;
    width: 170px;
    border: 2px solid transparent;
}

/* Regular items hover - NOT the current one */
.sidebar li:not(#current):hover {
    transform: translateX(5px) !important;
    backdrop-filter: blur(15px) !important;
}

body.light-mode .sidebar li:not(#current):hover {
    background: rgba(240, 98, 146, 0.2) !important;
    box-shadow: 0 2px 10px rgba(240, 98, 146, 0.1) !important;
}

body.dark-mode .sidebar li:not(#current):hover {
    background: rgba(63, 81, 181, 0.3) !important;
    box-shadow: 0 2px 10px rgba(63, 81, 181, 0.2) !important;
}

/* Current item base styling */
.sidebar li#current {
    transform: translateX(8px) !important;
    backdrop-filter: blur(15px) !important;
    border: 2px solid transparent !important;
}

body.light-mode .sidebar li#current {
    background: rgba(240, 98, 146, 0.3) !important;
    box-shadow: 0 4px 15px rgba(240, 98, 146, 0.15) !important;
}

body.dark-mode .sidebar li#current {
    background: rgba(63, 81, 181, 0.4) !important;
    box-shadow: 0 4px 15px rgba(63, 81, 181, 0.25) !important;
}

/* Current item hover - ONLY border changes */
body.light-mode .sidebar li#current:hover {
    border: 2px solid #f06292 !important;
    /* Force all other properties to stay the same */
    background: rgba(240, 98, 146, 0.3) !important;
    box-shadow: 0 4px 15px rgba(240, 98, 146, 0.15) !important;
    transform: translateX(8px) !important;
}

body.dark-mode .sidebar li#current:hover {
    border: 2px solid #3f51b5 !important;
    /* Force all other properties to stay the same */
    background: rgba(63, 81, 181, 0.4) !important;
    box-shadow: 0 4px 15px rgba(63, 81, 181, 0.25) !important;
    transform: translateX(8px) !important;
}

/* Icons */
.sidebar i {
    margin-right: 12px;
    transition: transform 0.3s ease;
}

/* Icon scaling ONLY for non-current items */
.sidebar li:not(#current):hover i {
    transform: scale(1.1);
}

/* Current item icon - no scaling on hover */
.sidebar li#current i {
    transform: scale(1) !important;
}

.sidebar li#current:hover i {
    transform: scale(1) !important;
}

.main {
    flex: 1;
    padding: 0 0 10px 10px; /* remove top padding so viewer can reach top */
    transition: background-color 0.3s, color 0.3s;
    display: flex;
    flex-direction: column;
}

.main-content {
    display: flex;
    flex: 1;
    gap: 15px;
    overflow: hidden;
}

.content-area {
    display: flex;
    flex: 1;
    gap: 15px;
    margin-top: 0; /* align content flush to top */
    overflow: hidden;
}

.file-list {
    display: flex;
    flex-wrap: wrap;
    flex: 0 0 350px; /* Fixed width */
    align-content: flex-start;
    overflow-y: auto;
    gap: 5px;
}

body.dark-mode .main{
    background-color: #212339;
    color: #e3f2fd;
}

body.light-mode .main{
    background-color: #fce4ec;
    color: #ad1457;
}

.toolbar {
    display: flex;
    align-items: center;
    margin-bottom: 0px;
    height: 40px; /* shorter toolbar */
    width: 500px;
    padding: 4px 8px;
}

/* Remove default link styling in file-list */
.file-list a {
    text-decoration: none;
    color: inherit;
}

.file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 150px;
    height: 150px;
    margin: 5px 0px 5px 5px;
    border-radius: 10px;
    transition: background-color 0.2s;
    text-align: center;
}
body.light-mode .file-item {
    border: 2px solid  #f06292;
}

body.dark-mode .file-item {
    border: 2px solid #3f51b5;
}

body.light-mode .file-item:hover {
    background: rgba(240, 98, 146, 0.2);
}

body.dark-mode .file-item:hover {
    background: rgba(63, 81, 181, 0.3);
}

.file-item i {
    font-size: 50px;
    margin-bottom: 20px;
}

.file-item span {
    font-size: 16px;
    word-wrap: break-word;
    max-width: 100%;
}

#taskbar {
    display: flex;
    justify-content: flex-end;
    background-color: #ececec;
    border-top: 1px solid #ccc;
}

button {
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

body.light-mode button {
    background-color: #f0f0f0;
    color: #3c3f3c;
}

body.dark-mode button {
    background-color: #444;
    color: #fff;
}

body {
    margin: 0 0 0 0;
    font-family: Arial, Helvetica, sans-serif;
    display: flex;
    flex-direction: column;
    height: 100vh; /* full viewport height */
}

.toolbar button {
    margin-right: 8px;
    padding: 4px 10px; /* reduced padding to shorten toolbar */
    border: none;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

body.light-mode .toolbar button {
    background: linear-gradient(180deg, 
        rgba(226, 116, 153, 0.95) 0%, 
        rgba(218, 102, 122, 0.9) 100%);
    color: #fff;
}

body.dark-mode .toolbar button {
    background: linear-gradient(90deg, #6289de 0%, #3d66ce 100%);
    color: #fff;
}

.toolbar button:hover, .toolbar button:focus {
    color: #fff;
    outline: none;
}

body.light-mode .toolbar button:hover, .toolbar button:focus {
    box-shadow: 0 4px 12px rgba(252, 5, 22, 0.758);
}

body.dark-mode .toolbar button:hover, .toolbar button:focus {
    box-shadow: 0 4px 12px rgba(29, 180, 240, 0.623);
}


.toolbar button:last-child {
    margin-right: 0;
}