/* ===== DungeonTools - Medieval Fantasy Theme =====
   Color palette inspired by Dungeons & Dragons:
   - Deep burgundy/red (D&D logo color)
   - Gold/amber (treasure, magic)
   - Dark brown/black (leather, parchment)
   - Cream/parchment (scrolls, paper)
   ================================================== */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #8b0000;
    --primary-dark: #660000;
    --secondary-color: #2c1810;
    --accent-color: #d4af37;
    --accent-light: #f4d03f;
    --light-color: #f5e7d3;
    --dark-color: #1a0a00;
    --success-color: #2e8b57;
    --error-color: #cc0000;
    --warning-color: #b8860b;
    --info-color: #4682b4;
    --parchment: #fff8e8;
    --border-radius: 4px;
    --box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    --transition: all 0.2s ease;
    --wood-texture: linear-gradient(90deg, #5a3e2b 0%, #3a241d 50%, #5a3e2b 100%);
}

body {
    font-family: 'Times New Roman', Times, serif;
    line-height: 1.7;
    color: #333;
    background: var(--wood-texture);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header - Dark wood with gold accents */
header {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-color));
    color: var(--accent-light);
    padding: 1rem 2rem;
    box-shadow: var(--box-shadow);
    border-bottom: 3px solid var(--accent-color);
}

.logo {
    height: 85px;
    width: auto;
    border: 2px solid var(--accent-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

header nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.welcome {
    font-size: 0.9rem;
    opacity: 0.9;
    font-style: italic;
}

.nav-link {
    color: var(--accent-light);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
}

.nav-link:hover {
    background-color: rgba(212, 175, 55, 0.2);
    text-shadow: 0 0 5px var(--accent-light);
}

/* Main Content */
main {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Header content wrapper */
header .container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Footer */
footer {
    background-color: var(--secondary-color);
    color: var(--accent-light);
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
    font-style: italic;
    border-top: 2px solid var(--primary-color);
}

/* Containers - Parchment look */
.login-container,
.form-container,
.dashboard-container,
.session-container,
.campaign-card {
    background: var(--parchment);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    padding: 2rem;
    max-width: 100%;
    border: 1px solid #d4af37;
}

.login-container {
    max-width: 500px;
    margin: 0 auto;
}

.form-container {
    max-width: 600px;
    margin: 0 auto;
}

.dashboard-container {
    max-width: 1200px;
}

.session-container {
    max-width: 1200px;
}

/* Login Form */
.login-form {
    margin-top: 1.5rem;
}

.credentials-list {
    list-style: none;
    background: linear-gradient(135deg, #f5e7d3, #e8d5b7);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    border: 1px solid var(--accent-color);
}

.credentials-list li {
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--accent-color);
    color: var(--primary-color);
}

.credentials-list li:last-child {
    border-bottom: none;
}

/* Forms */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.7rem;
    border: 2px solid #8b4513;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: 'Times New Roman', serif;
    transition: var(--transition);
    background: #fff8e8;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
    background: white;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Buttons - D&D style */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
    font-family: 'Times New Roman', serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #5a3e2b, #3a241d);
    color: var(--accent-light);
    border-bottom: 3px solid #2a180d;
}

.btn:hover {
    background: linear-gradient(135deg, #6a4e3b, #4a3828);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #a00000);
    color: var(--accent-light);
    border-bottom: 3px solid #5a0000;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #a00000, #8b0000);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #4a3828, #3a241d);
    color: var(--accent-light);
    border-bottom: 3px solid #2a180d;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a3e2b, #4a3828);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #8b0000, #660000);
    color: var(--accent-light);
    border-bottom: 3px solid #4a0000;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #cc0000, #8b0000);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Tables */
.sessions-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1.5rem;
    background: var(--parchment);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sessions-table th,
.sessions-table td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid #8b4513;
}

.sessions-table th {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--accent-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
}

.sessions-table tr:hover {
    background-color: rgba(245, 231, 211, 0.5);
}

.sessions-table a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

.sessions-table a:hover {
    text-decoration: underline;
    color: var(--primary-color);
}

/* Session View */
.session-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--accent-color);
}

.session-header h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.session-header .campaign,
.session-header .date {
    color: #5a3e2b;
    margin-bottom: 0.3rem;
    font-style: italic;
}

.session-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.dm-notes-box {
    background: linear-gradient(135deg, #fff8e8, #f5e7d3);
    border-left: 4px solid var(--warning-color);
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dm-notes-box h3 {
    color: var(--warning-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.session-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .session-content {
        grid-template-columns: 1fr;
    }
}

.notes-section,
.logs-section {
    background: var(--parchment);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #d4af37;
}

.notes-section h3,
.logs-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-color);
    font-size: 1.2rem;
}

/* Add Forms */
.add-form {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.add-form textarea {
    width: 100%;
    padding: 0.7rem;
    border: 2px solid #8b4513;
    border-radius: var(--border-radius);
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
    font-family: 'Times New Roman', serif;
    background: #fff8e8;
}

.add-form select {
    padding: 0.5rem;
    border: 2px solid #8b4513;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    background: #fff8e8;
    font-family: 'Times New Roman', serif;
}

/* Note and Log Cards */
.notes-list,
.logs-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.note-card,
.log-card {
    background: linear-gradient(135deg, #f5e7d3, #e8d5b7);
    border-radius: var(--border-radius);
    padding: 1rem;
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.note-card:hover,
.log-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.note-header,
.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.note-type,
.log-type {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: var(--border-radius);
    background-color: var(--primary-color);
    color: var(--accent-light);
    letter-spacing: 0.5px;
}

.note-time,
.log-time {
    font-size: 0.8rem;
    color: #5a3e2b;
    font-style: italic;
}

.btn-delete {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.2rem;
    opacity: 0.7;
    transition: var(--transition);
    text-decoration: none;
    font-weight: bold;
}

.btn-delete:hover {
    opacity: 1;
    text-shadow: 0 0 3px var(--error-color);
}

.note-content,
.log-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #2c1810;
}

/* Note Type Colors */
.note-plot { border-left-color: #800080; }
.note-plot .note-type { background-color: #800080; }
.note-npc { border-left-color: #228b22; }
.note-npc .note-type { background-color: #228b22; }
.note-location { border-left-color: #b8860b; }
.note-location .note-type { background-color: #b8860b; }
.note-item { border-left-color: #daa520; }
.note-item .note-type { background-color: #daa520; }
.note-quest { border-left-color: #4682b4; }
.note-quest .note-type { background-color: #4682b4; }
.note-general { border-left-color: #696969; }
.note-general .note-type { background-color: #696969; }
.note-map { border-left-color: #20b2aa; }
.note-map .note-type { background-color: #20b2aa; }

.note-attachment {
    margin-top: 10px;
    padding: 5px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.note-attachment img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
}

.file-input {
    margin-top: 5px;
}

/* Log Type Colors */
.log-combat { border-left-color: var(--error-color); }
.log-combat .log-type { background-color: var(--error-color); }
.log-dialogue { border-left-color: #4682b4; }
.log-dialogue .log-type { background-color: #4682b4; }
.log-puzzle { border-left-color: #daa520; }
.log-puzzle .log-type { background-color: #daa520; }
.log-reward { border-left-color: #228b22; }
.log-reward .log-type { background-color: #228b22; }
.log-clue { border-left-color: #800080; }
.log-clue .log-type { background-color: #800080; }
.log-event { border-left-color: #696969; }
.log-event .log-type { background-color: #696969; }

/* Empty Messages */
.empty-message {
    text-align: center;
    color: #8b4513;
    font-style: italic;
    padding: 1rem;
}

.note-count {
    color: #8b4513;
    font-size: 0.9rem;
}

/* Campaign Cards */
.campaign-card {
    background: linear-gradient(135deg, #f5e7d3, #e8d5b7);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--accent-color);
    border: 1px solid #d4af37;
}

.campaign-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.campaign-card h3 a {
    color: var(--primary-color);
    text-decoration: none;
}

.campaign-card h3 a:hover {
    text-decoration: underline;
}

.campaign-desc {
    color: #5a3e2b;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    font-style: italic;
}

.campaign-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 768px) {
    main {
        padding: 1rem;
    }
    
    header {
        padding: 1rem;
    }
    
    header nav {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .session-header-actions {
        flex-direction: column;
    }
    
    .sessions-table th,
    .sessions-table td {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
}
