/**
 * Copyright (c) 2025 Robert Amstadt
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

/* Base Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    margin: 0;
    padding: 20px;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.logo {
    font-size: 1.8em;
    font-weight: bold;
    color: #1e3c72;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.description {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Navigation */
.nav-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-links a {
    color: #3498db;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: background 0.2s;
}

.nav-links a:hover {
    background: rgba(52, 152, 219, 0.1);
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Buttons */
.btn {
    background: #3498db;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 10px;
    margin-bottom: 10px;
    font-size: 14px;
    transition: background 0.2s;
}

.btn:hover {
    background: #2980b9;
}

.btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-primary {
    background: #3498db;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-success {
    background: #27ae60;
}

.btn-success:hover {
    background: #229954;
}

.logout-btn {
    background: #e74c3c;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
}

.logout-btn:hover {
    background: #c0392b;
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card h2 {
    margin-top: 0;
    color: #1e3c72;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.card h3 {
    color: #1e3c72;
    margin-top: 0;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 14px;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #2a5298;
}

input[type="file"] {
    padding: 5px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #1e3c72;
}

.table tr:hover {
    background: #f8f9fa;
}

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

th, td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background: #f8f9fa;
    font-weight: bold;
    color: #1e3c72;
}

/* Messages */
.message {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.error {
    color: #e74c3c;
    margin-top: 10px;
    padding: 10px;
    background: #ffeaea;
    border-radius: 5px;
    border-left: 4px solid #e74c3c;
}

.success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #c3e6cb;
    margin-bottom: 20px;
}

.help-text {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

/* Status Badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
}

.status-admin {
    background: #3498db;
    color: white;
}

.status-user {
    background: #95a5a6;
    color: white;
}

.status-blocked {
    background: #e74c3c;
    color: white;
}

.status-scheduled {
    background: #f39c12;
    color: white;
}

.status-done {
    background: #27ae60;
    color: white;
}

.status-error {
    background: #e74c3c;
    color: white;
}

/* Track Items */
.track-list {
    max-height: 400px;
    overflow-y: auto;
}

.track-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.track-item:last-child {
    border-bottom: none;
}

.track-info {
    flex: 1;
}

.track-artist {
    font-weight: bold;
    color: #2c3e50;
}

.track-title {
    color: #7f8c8d;
    font-size: 0.9em;
}

.track-time {
    color: #95a5a6;
    font-size: 0.8em;
    white-space: nowrap;
}

/* File Items */
.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.file-item:last-child {
    border-bottom: none;
}

.file-name {
    flex: 1;
    word-break: break-word;
}

.file-actions {
    display: flex;
    gap: 5px;
}

/* Links */
.links {
    margin-top: 20px;
    text-align: center;
}

.links a {
    color: #3498db;
    text-decoration: none;
    margin: 0 10px;
}

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

.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: #3498db;
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
}

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

.close:hover {
    color: black;
}

/* Update Indicator */
.update-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    background: #27ae60;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s;
}

.update-indicator.active {
    opacity: 1;
}

/* Grid Layouts */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

/* Directory Items */
.directory-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
}

.directory-item:hover {
    background: #e9ecef;
}

.directory-item.active {
    background: #d4edda;
    border: 2px solid #27ae60;
}

/* Invite Form */
.invite-form {
    margin-top: 15px;
}

.invite-form input[type="email"] {
    width: 70%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    margin-right: 10px;
}

.invite-btn {
    background: #3498db;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.invite-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* Stream Links */
.stream-link {
    display: inline-block;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    margin: 10px 0;
    transition: transform 0.2s;
}

.stream-link:hover {
    transform: translateY(-2px);
}

/* Info Boxes */
.invite-info {
    background: #e8f4fd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #3498db;
}

.note {
    color: #666;
    margin-top: 10px;
    font-size: 14px;
}

/* Responsive Base */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .main-content {
        grid-template-columns: 1fr;
    }

    .header {
        flex-direction: column;
        gap: 10px;
    }

    .invite-form input[type="email"] {
        width: 100%;
        margin-bottom: 10px;
        margin-right: 0;
    }

    .upload-grid {
        grid-template-columns: 1fr;
    }

    .directory-grid {
        grid-template-columns: 1fr;
    }
}
