/* Legendary Letters - Main Stylesheet */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: #fff;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: #2c3e50;
}

nav a {
    margin-left: 15px;
    text-decoration: none;
    color: #3498db;
}

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

/* Auth Pages */
.auth-box {
    max-width: 400px;
    margin: 50px auto;
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.auth-box h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 10px;
}

.auth-box h2 {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 30px;
    font-size: 1.2em;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #7f8c8d;
    font-size: 0.9em;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s;
}

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

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

.btn-secondary {
    background-color: #95a5a6;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-danger {
    background-color: #e74c3c;
    color: #fff;
}

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

/* Error Messages */
.error-message {
    color: #e74c3c;
    margin: 10px 0;
    padding: 10px;
    background: #fee;
    border-radius: 4px;
    display: none;
}

.error-message.show {
    display: block;
}

/* Success Messages */
.success-message {
    color: #27ae60;
    margin: 10px 0;
    padding: 10px;
    background: #efe;
    border-radius: 4px;
    display: none;
}

.success-message.show {
    display: block;
}

/* Auth Links */
.auth-link {
    text-align: center;
    margin-top: 20px;
    color: #7f8c8d;
}

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

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

/* Children List */
.children-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.child-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.child-card h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.child-actions {
    display: flex;
    gap: 10px;
}

.child-actions .btn {
    flex: 1;
    text-align: center;
}

/* Series List */
.series-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.series-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.series-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 15px;
}

.series-card h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.series-card p {
    color: #7f8c8d;
    margin-bottom: 15px;
}

/* Enrollments */
.enrollments-list {
    margin-top: 20px;
}

.enrollment-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.enrollment-card h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.letters-list {
    margin-top: 15px;
}

.letter-item {
    background: #f9f9f9;
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.letter-item.locked {
    opacity: 0.6;
}

.letter-item.unlocked {
    cursor: pointer;
}

.letter-item.unlocked:hover {
    background: #f0f0f0;
}

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

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* Loading */
.loading {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
}

/* Sections */
section {
    background: #fff;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

