/* RKIUK - German Red Cross Color Scheme */
:root {
    --drk-red: #CC0000;
    --drk-dark-red: #990000;
    --drk-white: #FFFFFF;
    --drk-light-gray: #F5F5F5;
    --drk-gray: #E0E0E0;
    --drk-dark-gray: #333333;
    --drk-text: #212121;
}

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

html {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--drk-light-gray);
    color: var(--drk-text);
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* Module page wrapper ensures footer stays at bottom */
body.module-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Login Page Styles */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--drk-red) 0%, var(--drk-dark-red) 100%);
}

.login-container {
    background: var(--drk-white);
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: var(--drk-red);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--drk-dark-gray);
    font-size: 1rem;
}

.login-form {
    display: flex;
    flex-direction: column;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--drk-dark-gray);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--drk-gray);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--drk-red);
}

.btn-primary {
    background-color: var(--drk-red);
    color: var(--drk-white);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: var(--drk-dark-red);
}

.btn-secondary {
    background-color: var(--drk-white);
    color: var(--drk-red);
    padding: 0.5rem 1rem;
    border: 2px solid var(--drk-red);
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background-color: var(--drk-red);
    color: var(--drk-white);
}

/* Button sizes */
.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-danger:hover {
    background-color: #c82333;
}

.error-message {
    color: var(--drk-red);
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

/* OAuth Login Styles */
.oauth-section {
    margin-top: 2rem;
}

.oauth-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.oauth-divider::before,
.oauth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background-color: var(--drk-gray);
}

.oauth-divider::before {
    left: 0;
}

.oauth-divider::after {
    right: 0;
}

.oauth-divider span {
    color: var(--drk-dark-gray);
    font-size: 0.9rem;
    background: white;
    padding: 0 1rem;
}

.btn-oauth {
    width: 100%;
    background: linear-gradient(135deg, #0066CC 0%, #0052A3 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-oauth:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.btn-oauth svg {
    flex-shrink: 0;
}

/* Main Page Styles */
.main-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header {
    background: linear-gradient(135deg, var(--drk-red) 0%, var(--drk-dark-red) 100%);
    color: var(--drk-white);
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    gap: 2rem;
}

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

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.user-role {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.user-name {
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
}

.settings-link,
.admin-link {
    color: var(--drk-white);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.settings-link:hover,
.admin-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.admin-link {
    background: rgba(0, 102, 204, 0.2);
    border: 1px solid rgba(0, 102, 204, 0.3);
    margin-left: 0.5rem;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 5px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    color: white;
    padding: 0;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.25);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

.desktop {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.desktop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.module-placeholder {
    background: var(--drk-white);
    border: 3px dashed var(--drk-gray);
    border-radius: 10px;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--drk-dark-gray);
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.module-card {
    background: var(--drk-white);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    border-color: var(--drk-red);
}

.module-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.module-title {
    color: var(--drk-red);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.module-description {
    color: var(--drk-dark-gray);
    font-size: 0.9rem;
}

/* Admin Dashboard Card - Special Styling */
.module-card-admin {
    border: 2px solid #0066CC;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.05) 0%, rgba(0, 82, 163, 0.05) 100%);
}

.module-card-admin:hover {
    border-color: #0066CC;
    box-shadow: 0 5px 20px rgba(0, 102, 204, 0.25);
}

.module-card-admin .module-title {
    color: #0066CC;
}

.module-card-admin .module-icon {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.1) 0%, rgba(0, 82, 163, 0.1) 100%);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    margin: 0 auto 1rem;
}

.footer {
    background-color: var(--drk-dark-gray);
    color: var(--drk-white);
    text-align: center;
    padding: 1rem;
    margin-top: auto;
}

.footer p {
    font-size: 0.9rem;
}

/* Module Page Styles */
.module-content {
    flex: 1;
    background: var(--drk-light-gray);
    padding: 1.5rem;
    min-height: 0;
}

/* Stats Dashboard */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: transparent;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-card.stat-warning {
    border-top: 4px solid #FF8C00;
}

.stat-card.stat-danger {
    border-top: 4px solid #E30613;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--drk-red);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.95rem;
    color: var(--drk-dark-gray);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    background: var(--drk-white);
    border-bottom: 1px solid var(--drk-gray);
    flex-wrap: wrap;
}

.toolbar button {
    white-space: nowrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-group label {
    font-weight: 500;
    color: var(--drk-dark-gray);
    white-space: nowrap;
}

.filter-group select {
    padding: 0.6rem 1rem;
    border: 2px solid var(--drk-gray);
    border-radius: 6px;
    font-size: 0.95rem;
    background: white;
    color: var(--drk-text);
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--drk-red);
}

.search-box {
    margin-left: auto;
}

.search-box input {
    padding: 0.6rem 1rem;
    border: 2px solid var(--drk-gray);
    border-radius: 6px;
    font-size: 0.95rem;
    width: 250px;
    transition: border-color 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--drk-red);
}

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

.modal-content {
    background-color: var(--drk-white);
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

.modal-content.large {
    max-width: 900px;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--drk-red), var(--drk-dark-red));
    color: white;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-header .close {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.modal-header .close:hover {
    opacity: 1;
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--drk-gray);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    border-radius: 0 0 8px 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

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

    .login-container {
        margin: 1rem;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar button {
        width: 100%;
    }
    
    .search-box {
        margin-left: 0;
        width: 100%;
    }
    
    .search-box input {
        width: 100%;
    }
}

/* Dark Mode Styles */
body.dark-mode {
    --drk-red: #E30613;
    --drk-dark-red: #CC0000;
    --drk-white: #1E1E1E;
    --drk-light-gray: #121212;
    --drk-gray: #2D2D2D;
    --drk-dark-gray: #E0E0E0;
    --drk-text: #E0E0E0;
}

body.dark-mode .login-container {
    background: #1E1E1E;
    color: #E0E0E0;
}

body.dark-mode .login-header h1 {
    color: #E30613;
}

body.dark-mode .login-header p {
    color: #E0E0E0;
}

body.dark-mode .form-group label {
    color: #E0E0E0;
}

body.dark-mode .form-group input {
    background-color: #2D2D2D;
    border-color: #3D3D3D;
    color: #E0E0E0;
}

body.dark-mode .module-card,
body.dark-mode .module-placeholder,
body.dark-mode .toolbar,
body.dark-mode .settings-tab {
    background: #1E1E1E;
    color: #E0E0E0;
}

body.dark-mode .module-card {
    border-color: #2D2D2D;
}

body.dark-mode .module-card:hover {
    border-color: #E30613;
}

body.dark-mode .module-title {
    color: #E30613;
}

body.dark-mode .module-description,
body.dark-mode .placeholder-icon {
    color: #B0B0B0;
}

/* Dark Mode - Admin Dashboard Card */
body.dark-mode .module-card-admin {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%);
    border-color: #3B82F6;
}

body.dark-mode .module-card-admin:hover {
    border-color: #3B82F6;
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.3);
}

body.dark-mode .module-card-admin .module-title {
    color: #3B82F6;
}

body.dark-mode .module-card-admin .module-icon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.15) 100%);
}

body.dark-mode .header {
    background: linear-gradient(135deg, #E30613 0%, #CC0000 100%);
}

body.dark-mode .btn-secondary {
    background-color: #2D2D2D;
    color: #E0E0E0;
    border-color: #E30613;
}

body.dark-mode .btn-secondary:hover {
    background-color: #E30613;
    color: #FFFFFF;
}

body.dark-mode .footer {
    background-color: #0D0D0D;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background-color: #2D2D2D;
    border-color: #3D3D3D;
    color: #E0E0E0;
}

body.dark-mode .tab-button {
    color: #B0B0B0;
}

body.dark-mode .tab-button:hover,
body.dark-mode .tab-button.active {
    color: #E30613;
}

body.dark-mode .toggle-text strong {
    color: #E0E0E0;
}

body.dark-mode .toggle-text small {
    color: #B0B0B0;
}

body.dark-mode .stat-card {
    background: #1E1E1E;
    border-color: #3D3D3D;
}

body.dark-mode .stat-value {
    color: #E30613;
}

body.dark-mode .stat-label {
    color: #B0B0B0;
}

/* Header with Settings Link */
.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 5px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
    color: white;
    padding: 0;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-icon svg {
    width: 24px;
    height: 24px;
}

.settings-link {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 5px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s;
    color: white;
    text-decoration: none;
    font-weight: 500;
}

.settings-link:hover {
    background: rgba(255, 255, 255, 0.3);
}

