@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:wght@400..800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:wght@400..800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap');

h1, h2, h3, h4, h5, h6,
.collapsible,
.login-container h1,
.login-container h2 {
    font-family: 'EB Garamond', serif;
}

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

body {
    font-family: 'Lato', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    transition: background-color 0.3s, color 0.3s;
}

/* Login Styles */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: background-color 0.3s;
    text-align: center;
}

.login-container h1 {
    color: #808080;
    font-size: 24px;
    margin-bottom: 10px;
}

.login-container h2 {
    color: #ff8c00;
    font-size: 18px;
    margin-bottom: 20px;
}

/* Header Styles */
.header {
    background: #fff;
    padding: 20px;
    border-bottom: 2px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s, border-color 0.3s;
}

.header h1 {
    color: #808080;
    font-size: 24px;
}

.nav {
    display: flex;
    align-items: center;
}

.nav a {
    margin-left: 20px;
    text-decoration: none;
    color: rgb(140, 115, 75);
}

.nav a:hover {
    text-decoration: underline;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 5px;
    transition: background-color 0.3s;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    text-align: left;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}

button {
    background: rgb(140, 115, 75);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background: rgb(140, 115, 75);
}

/* Messages */
.error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 3px;
    margin-bottom: 20px;
}

.message {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 3px;
    margin-bottom: 20px;
}

/* Admin Page */
.create-user-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 30px;
    transition: background-color 0.3s;
}

.users-table {
    margin-top: 30px;
}

.users-table table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th,
.users-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    transition: border-color 0.3s;
}

.users-table th {
    background: #f8f9fa;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.users-table tr:hover {
    background: #f5f5f5;
    transition: background-color 0.3s;
}

.users-table a {
    color: rgb(140, 115, 75);
    text-decoration: none;
}

.users-table a:hover {
    text-decoration: underline;
}

/* Dashboard File Browser */
.breadcrumb {
    margin-bottom: 20px;
    font-size: 1.1em;
}

.breadcrumb a {
    color: rgb(140, 115, 75);
    text-decoration: none;
}

.actions-bar {
    margin-bottom: 20px;
}

.users-table tr.selected {
    background-color: #c8e6c9; 
}


/* Modal Styles */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 5px;
    transition: background-color 0.3s, border-color 0.3s;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Dark Mode Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
  margin-left: 20px;
  vertical-align: middle;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: rgb(140, 115, 75);
}

input:focus + .slider {
  box-shadow: 0 0 1px rgb(140, 115, 75);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}


/* Dark Mode Styles */
body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

.dark-mode .header,
.dark-mode .container,
.dark-mode .login-container,
.dark-mode .create-user-form {
    background-color: #1e1e1e;
    border-color: #333;
}

.dark-mode .header h1,
.dark-mode .login-container h1 {
    color: #c0c0c0;
}

.dark-mode .login-container h2 {
    color: #ff9d3f;
}

.dark-mode .nav a,
.dark-mode .breadcrumb a,
.dark-mode .users-table a {
    color: rgb(140, 115, 75);
}

.dark-mode .form-group input,
.dark-mode .form-group select {
    background-color: #2c2c2c;
    border-color: #444;
    color: #e0e0e0;
}

.dark-mode button {
    background: rgb(140, 115, 75);
}

.dark-mode button:hover {
    background: #675333;
}

.dark-mode .users-table th {
    background: #2a2a2a;
}

.dark-mode .users-table tr:hover {
    background: #252525;
}

.dark-mode .users-table tr.selected {
    background-color: #2a5c3d;
}

.dark-mode .users-table td {
    border-bottom-color: #333;
}

.dark-mode .modal-content {
    background-color: #2c2c2c;
    border-color: #444;
}

.dark-mode .close {
    color: #ccc;
}
.dark-mode .close:hover {
    color: #fff;
}


/* Responsive */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 10px;
    }
    
    .users-table {
        overflow-x: auto;
    }
}

.users-table .user-form-cell {
    min-width: 160px;
}

.users-table .user-form-cell input,
.users-table .user-form-cell select {
    width: 90%; 
}

.users-table .action-buttons button {
    margin-right: 5px;
    padding: 5px 10px;
    font-size: 14px;
}

.users-table .password-field-container {
    margin-top: 10px;
    display: none; 
}

.users-table tr.editing-row {
    background-color: #e8f0fe; 
}

.dark-mode .users-table tr.editing-row {
    background-color: #675333; 
}

/* Collapsible Section Styles */
.collapsible {
  background-color: #f1f1f1;
  color: #444;
  cursor: pointer;
  padding: 18px;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 20px;
  margin-top: 10px;
  border-radius: 5px;
  font-weight: bold;
}

.collapsible:after {
  content: '\002B'; /* Plus sign */
  color: #777;
  font-weight: bold;
  float: right;
  margin-left: 5px;
}

.collapsible.active:after {
  content: "\2212"; /* Minus sign */
}

.panel {
  padding: 0 18px;
  background-color: white;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease-out;
  border-radius: 0 0 5px 5px;
  border: 1px solid #ddd;
  border-top: none;
}

/* Dark Mode styles for collapsible */
.dark-mode .collapsible {
    background-color: #2a2a2a;
    color: #e0e0e0;
}

.dark-mode .panel {
    background-color: #1e1e1e;
    border-color: #333;
}

a {
    color:rgb(140, 115, 75);
}

.users-table {
    width:100%;
}