/* Base styles */
body {
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f4f8;
    margin: 0;
    color: #333;
    min-height: 100vh;
    font-size: 16px; /* Base font size for scalability */
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    margin: 0;
    font-size: 2rem; /* Reduced for mobile */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

nav {
    background-color: #34495e;
    padding: 0.5rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

nav a {
    color: white;
    text-decoration: none;
    font-size: 1rem;
}

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

main {
    flex: 1;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.9rem;
    width: 100%;
}

/* Form elements */
button {
    background-color: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    padding: 0.75rem 1rem;
    border-radius: 5px;
    font-size: 1rem;
    transition: background-color 0.3s;
    min-width: 100px; /* Ensure touch-friendly size */
    touch-action: manipulation; /* Improve touch responsiveness */
}

button:hover {
    background-color: #2980b9;
}

button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

select, input[type="number"], input[type="time"] {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    width: 100%;
    box-sizing: border-box;
    min-height: 40px; /* Touch-friendly height */
}

select:focus, input[type="number"]:focus, input[type="time"]:focus {
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52,152,219,0.5);
    outline: none;
}

input[type="checkbox"] {
    transform: scale(1.2);
    margin-right: 0.5rem;
}

/* Index page specific styles */
#panels-container {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}

#main-panel, #right-panel,#right-panel-user {
    padding: 1rem;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.right-container {
  display: flex;
  flex-direction: column;
  gap: 20px; /* Adds space between the two asides */
}

#main-panel {
    flex: 3;
}

#right-panel {
    flex: 1;
}

#filters {
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

#filters label {
    font-weight: 500;
    color: #2c3e50;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    border: 1px solid #e0e0e0;
    padding: 0.75rem;
    text-align: left;
    font-size: 0.9rem;
}

th {
    background-color: #3498db;
    color: white;
    font-weight: 600;
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

tr:hover {
    background-color: #e9ecef;
}

#playlist-options {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#playlist-options label {
    font-weight: 500;
    color: #2c3e50;
}

.deleted {
    text-decoration: line-through;
    color: #e74c3c;
}

#pagination {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    align-items: center;
}

#pagination button {
    padding: 0.5rem 0.75rem;
}

#pagination span {
    font-size: 0.9rem;
    color: #2c3e50;
}

/* Settings page specific styles */
#settings-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 1rem;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#global-settings {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

label {
    font-weight: 500;
    color: #2c3e50;
}

/* Mobile-friendly adjustments */
@media (max-width: 768px) {
    body {
        font-size: 14px; /* Slightly smaller base font for mobile */
    }

    header h1 {
        font-size: 1.5rem;
    }

    nav {
        flex-direction: column;
        align-items: center;
    }

    nav a {
        font-size: 0.9rem;
        margin: 0.5rem 0;
    }

    main {
        padding: 0.5rem;
    }

    #panels-container {
        flex-direction: column;
    }

    #main-panel, #right-panel {
        margin: 0.5rem 0;
    }

    #filters {
        flex-direction: column;
        align-items: stretch;
    }

    table {
        display: block;
        overflow-x: auto; /* Enable horizontal scrolling for tables */
        white-space: nowrap;
    }

    th, td {
        min-width: 100px; /* Ensure columns are readable */
        padding: 0.5rem;
    }

    #pagination button {
        padding: 0.5rem;
        min-width: 80px;
    }

    #settings-container {
        max-width: 100%;
        padding: 0.5rem;
    }

    button, select, input[type="number"], input[type="time"] {
        font-size: 0.9rem;
        padding: 0.5rem;
        min-height: 36px; /* Slightly smaller but still touch-friendly */
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.2rem;
    }

    footer {
        font-size: 0.8rem;
    }

    #pagination span {
        font-size: 0.8rem;
    }

    th, td {
        font-size: 0.8rem;
        padding: 0.4rem;
    }
}