/* Secret Santa Application Styles */

:root {
    --primary-color: #c41e3a;
    --primary-dark: #8b1528;
    --secondary-color: #165b33;
    --secondary-dark: #0d3d22;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-light: #666666;
    --border-color: #dddddd;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
}

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

/* Login */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.login-container h1 {
    color: var(--primary-color);
    margin-bottom: 30px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

/* Header */
.dashboard-header, .participant-header {
    background: var(--primary-color);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header h1, .participant-header h1 {
    margin: 0;
    font-size: 24px;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.participant-email {
    font-size: 14px;
    opacity: 0.9;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    color: var(--text-color);
    font-size: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

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

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 12px;
}

.form-inline {
    display: flex;
    gap: 10px;
    align-items: center;
}

.form-inline select {
    flex: 1;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

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

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

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

.btn-danger {
    background: var(--danger-color);
    color: white;
}

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

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

/* Campaign Cards */
.campaigns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.campaign-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.campaign-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

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

.campaign-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.campaign-status.active {
    background: #e3f2fd;
    color: #1976d2;
}

.campaign-status.drawn {
    background: #f1f8e9;
    color: #558b2f;
}

.campaign-meta {
    margin-top: 10px;
    color: var(--text-light);
    font-size: 14px;
}

.campaign-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

/* Campaign Info */
.campaign-info {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.campaign-info-item {
    margin-bottom: 15px;
}

.campaign-info-item label {
    font-weight: 500;
    display: block;
    margin-bottom: 5px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: -2px;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 500;
}

.tab-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-color);
    font-weight: 500;
}

/* Wishlist Items */
.wishlist-items {
    display: grid;
    gap: 15px;
}

.wishlist-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
}

.wishlist-item h4 {
    color: var(--secondary-color);
    margin-bottom: 8px;
}

.wishlist-item-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.wishlist-item.read-only {
    background: var(--bg-color);
}

/* Chat Interface */
.chat-container {
    background: #fafafa;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    max-height: 500px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    display: flex;
    margin-bottom: 10px;
}

.chat-message-sent {
    justify-content: flex-end;
}

.chat-message-received {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
}

.chat-bubble-sent {
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-bubble-received {
    background: white;
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.chat-sender {
    font-size: 12px;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 4px;
}

.chat-text {
    font-size: 14px;
    line-height: 1.4;
}

.chat-time {
    font-size: 11px;
    margin-top: 4px;
    opacity: 0.7;
}

.chat-bubble-sent .chat-time {
    text-align: right;
    color: rgba(255, 255, 255, 0.8);
}

.chat-bubble-received .chat-time {
    color: var(--text-light);
}

.chat-input-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-top: 15px;
}

.chat-input-form .form-group {
    flex: 1;
}

.chat-input-form textarea {
    resize: none;
    font-size: 14px;
}

.chat-input-form .btn {
    margin-bottom: 0;
    white-space: nowrap;
}

/* Exclusions */
.exclusions-list {
    display: grid;
    gap: 10px;
}

.exclusion-item {
    background: var(--bg-color);
    padding: 10px 15px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Assignment Card */
.assignment-card {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
    color: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
}

.assignment-card h2 {
    font-size: 28px;
    margin: 10px 0;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

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

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state h3 {
    margin-bottom: 10px;
    color: var(--text-color);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 15px 20px;
    min-width: 250px;
    max-width: 400px;
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast-icon {
    font-size: 20px;
}

.toast-message {
    flex: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast.hiding {
    animation: slideOut 0.3s ease-out forwards;
}

/* Participant Name Display */
.name-display-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-header, .participant-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .header-actions {
        flex-direction: column;
        width: 100%;
    }

    .name-display-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .name-display-container button {
        align-self: flex-start;
    }

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

    .form-inline {
        flex-direction: column;
    }

    .form-inline select {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .toast {
        bottom: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
    }

    .chat-bubble {
        max-width: 85%;
    }

    .chat-input-form {
        flex-direction: column;
        align-items: stretch;
    }

    .chat-input-form .btn {
        width: 100%;
    }
}

/* Markdown Editor Override */
.EasyMDEContainer {
    margin-top: 5px;
}

.CodeMirror {
    border: 1px solid var(--border-color);
    border-radius: 4px;
}
