/* style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f4f6f9;
    color: #333;
    line-height: 1.6;
}

/* Layout */
.dashboard-layout, .auth-container {
    min-height: 100vh;
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: #1a1a2e;
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    margin-bottom: 20px;
}

.logo {
    width: 180px;
    margin-bottom: 15px;
}

.sidebar-header .links {
    display: block;
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
    margin: 10px 0;
}

.sidebar-header .links:hover {
    color: white;
}

.sidebar h2 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.module-list {
    list-style: none;
    padding: 0;
    flex-grow: 1;
}

.module-item {
    margin: 8px 0;
}

.module-link {
    display: block;
    padding: 12px 15px;
    color: #aaa;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.module-link:hover, .module-link.active {
    background: #16213e;
    color: white;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
}

.sidebar-footer button {
    width: 100%;
    padding: 12px;
    background: #e94560;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.sidebar-footer button:hover {
    background: #d0314c;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: white;
    border-radius: 12px 0 0 12px;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

.main-content h2 {
    color: #1a1a2e;
    margin-bottom: 15px;
}

.main-content p {
    color: #555;
    margin-bottom: 20px;
}

/* Iframe Container (Canva Embeds) */
.iframe-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    box-shadow: 0 2px 8px rgba(63,69,81,0.16);
    margin: 20px 0;
    overflow: hidden;
    border-radius: 8px;
    will-change: transform;
}

.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    padding: 0;
    margin: 0;
    loading: lazy;
}

/* Loading Spinner */
.loading-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 50px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Auth Pages (Login/Register) */
.auth-container {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: url('https://faithnjogu.com/wp-content/uploads/2024/09/faith-njogu-logo-4.png') no-repeat center top 20px;
    background-size: 120px;
    min-height: 100vh;
}

.auth-box {
    width: 100%;
    max-width: 400px;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: center;
}

.auth-box h2 {
    color: #1a1a2e;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.auth-box label {
    display: block;
    text-align: left;
    margin: 10px 0 5px;
    color: #333;
    font-size: 14px;
}

.auth-box input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.auth-box button {
    margin-top: 20px;
    width: 100%;
    padding: 12px;
    background: #16213e;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.auth-box button:hover {
    background: #0f172a;
}

.auth-box a {
    display: block;
    margin-top: 15px;
    color: #e94560;
    text-decoration: none;
    font-size: 14px;
}

.auth-box a:hover {
    text-decoration: underline;
}

/* Admin Dashboard Table */
.admin-container {
    padding: 30px;
    background: #f9f9f9;
    min-height: 100vh;
}

.admin-container h1 {
    color: #1a1a2e;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #1a1a2e;
    color: white;
}

tr:hover {
    background: #f1f1f1;
}

.btn-edit {
    color: #16213e;
    font-size: 14px;
    text-decoration: none;
}

.btn-edit:hover {
    text-decoration: underline;
}

.btn-delete {
    color: #e94560;
    text-decoration: none;
    font-size: 14px;
}

.btn-delete:hover {
    text-decoration: underline;
}

/* Messages */
.error {
    color: #e94560;
    margin: 10px 0;
}

.success {
    color: #27ae60;
    margin: 10px 0;
}

/* Form Styling */
.form-container {
    max-width: 600px;
    margin: 20px auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
    border-color: #e94560; /* Faith Njogu brand color */
    box-shadow: 0 0 5px rgba(233, 69, 96, 0.5);
}

.form-actions {
    text-align: right;
}

.form-actions button,
.form-actions a {
    margin-left: 10px;
    padding: 10px 20px;
    background: #e94560;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.form-actions button:hover,
.form-actions a:hover {
    background: #d0314c;
}

.error {
    color: #e94560;
    margin-top: 10px;
}

.success {
    color: #27ae60;
    margin-top: 10px;
}