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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #6C3BAA;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

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

header {
    color: white;
    margin-bottom: 40px;
    padding: 20px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* User Info in Header */
#user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

#user-display-name {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.95;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
    flex-wrap: wrap;
}

.card h2 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.8rem;
}

/* Authentication Forms */
.auth-form {
    max-width: 400px;
    margin: 0 auto;
}

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

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e7ff;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: #6C3BAA;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.auth-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.95rem;
}

.auth-form small {
    display: block;
    color: #666;
    font-size: 0.85rem;
    margin-top: 5px;
}

.auth-form button[type="submit"] {
    width: 100%;
    margin-top: 10px;
}

.form-footer {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 0.95rem;
}

.form-footer a {
    color: #6C3BAA;
    text-decoration: none;
    font-weight: 600;
}

.form-footer a:hover {
    text-decoration: underline;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid #c33;
    font-size: 0.95rem;
}

.card h3 {
    color: #34495e;
    margin-bottom: 15px;
    margin-top: 25px;
    font-size: 1.3rem;
}

/* User Info Styles */
.user-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.user-info p {
    margin-bottom: 10px;
    font-size: 1rem;
    line-height: 1.6;
}

.user-info strong {
    color: #2c3e50;
    display: inline-block;
    width: 140px;
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle input:checked + .toggle-slider {
    background-color: #6C3BAA;
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.toggle-label {
    font-size: 1rem;
    color: #2c3e50;
    font-weight: 500;
}

/* Settings Form */
.settings-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

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

.form-group input[type="text"],
.form-group input[type="time"],
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e7ff;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #6C3BAA;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236C3BAA' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

/* Bundles List */
.bundles-section {
    margin-top: 20px;
}

.bundles-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.bundle-tag {
    background: #6C3BAA;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.bundle-tag-custom {
    background: #10b981;
    border: 2px dashed #059669;
}

/* Available Bundles */
.available-bundles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.bundle-option {
    background: #f8f9fa;
    border: 2px solid #e0e7ff;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bundle-option:hover {
    border-color: #6C3BAA;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.bundle-option.selected {
    border-color: #6C3BAA;
    background: #e0e7ff;
}

.bundle-option input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.bundle-option label {
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.bundle-info {
    flex: 1;
}

.bundle-info h5 {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 1rem;
}

.bundle-info p {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

.help-text {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background: #6C3BAA;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e0e7ff;
    color: #6C3BAA;
}

.btn-secondary:hover {
    background: #c7d2fe;
}

.btn-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 1;
}

.btn-close:hover {
    color: #666;
}

/* Chat Styles */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    background: #fafafa;
}

.message {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    max-width: 80%;
    line-height: 1.5;
}

.message.user {
    background: #6C3BAA;
    color: white;
    margin-left: auto;
    text-align: right;
}

.message.assistant {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
}

.message.system {
    background: #e8f5e9;
    color: #2e7d32;
    text-align: center;
    margin: 0 auto;
    font-style: italic;
}

.chat-input-container {
    display: flex;
    gap: 10px;
}

.chat-input-container input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.chat-input-container input:focus {
    outline: none;
    border-color: #6C3BAA;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Email Input */
.email-input-container {
    display: flex;
    gap: 10px;
    flex-direction: column;
}

.email-input-container input {
    padding: 14px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1.1rem;
}

.email-input-container input:focus {
    outline: none;
    border-color: #6C3BAA;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Responsive */
@media (max-width: 600px) {
    header h1 {
        font-size: 2rem;
    }

    .card {
        padding: 20px;
    }

    .message {
        max-width: 90%;
    }

    .chat-input-container {
        flex-direction: column;
    }
}

/* Recommendations Section */
.recommendations-divider {
    grid-column: 1 / -1;
    margin: 30px 0 20px 0;
    padding-top: 30px;
    border-top: 2px solid #e0e7ff;
}

.recommendations-divider h4 {
    color: #6C3BAA;
    font-size: 1.2rem;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.bundle-recommended {
    background: #f0f4ff;
    border: 2px dashed #c7d2fe;
}

.bundle-recommended:hover {
    border-color: #6C3BAA;
    border-style: solid;
}

.bundle-recommended.selected {
    background: #e0e7ff;
    border-style: solid;
}

/* Custom Bundles Section */
.custom-bundles-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e0e7ff;
}

.custom-bundles-section h4 {
    color: #6C3BAA;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.custom-bundles-section h5 {
    color: #2c3e50;
    font-size: 1rem;
    margin-bottom: 15px;
    margin-top: 25px;
}

.custom-bundle-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.custom-bundle-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e7ff;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    transition: all 0.3s ease;
    resize: vertical;
}

.custom-bundle-form textarea:focus {
    outline: none;
    border-color: #6C3BAA;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#custom-bundles-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.custom-bundle-item {
    background: #f0f4ff;
    border: 2px solid #10b981;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.custom-bundle-info {
    flex: 1;
}

.custom-bundle-info h6 {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 600;
}

.custom-bundle-info p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.custom-bundle-actions {
    display: flex;
    gap: 5px;
}

.btn-delete {
    background: #ef4444;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    background: #dc2626;
    transform: translateY(-1px);
}
