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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0f0f0f;
    color: #e0e0e0;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 20px;
    gap: 20px;
}

/* Header */
.header {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid #2a2a2a;
}

.header h1 {
    font-size: 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

#username {
    font-weight: 500;
    color: #e0e0e0;
}

.login-btn, .register-btn, .logout-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.login-btn {
    background: #667eea;
    color: white;
}

.login-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.register-btn {
    background: #10b981;
    color: white;
}

.register-btn:hover {
    background: #059669;
    transform: translateY(-2px);
}

.logout-btn {
    background: #ef4444;
    color: white;
}

.logout-btn:hover {
    background: #dc2626;
}

.discord-btn {
    width: 100%;
    padding: 12px;
    background: #5865F2;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.discord-btn:hover {
    background: #4752C4;
}

.separator {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.separator::before,
.separator::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #2a2a2a;
}

.separator::before {
    left: 0;
}

.separator::after {
    right: 0;
}

.separator span {
    background: #1a1a1a;
    padding: 0 15px;
    color: #888;
    font-size: 14px;
}

.error-message {
    background: #3f1515;
    color: #fca5a5;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    border: 1px solid #7f1d1d;
}

.success-message {
    background: #14532d;
    color: #86efac;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    border: 1px solid #166534;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 12px;
}

/* Main Content */
.main-content {
    display: flex;
    gap: 20px;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: #1a1a1a;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid #2a2a2a;
}

.search-container {
    margin-bottom: 15px;
}

.search-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #2a2a2a;
    background: #0f0f0f;
    color: #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.morph-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
}

.morph-item {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #0f0f0f;
    border: 1px solid #2a2a2a;
}

.morph-item:hover {
    background: #252525;
    transform: translateX(5px);
    border-color: #3a3a3a;
}

.morph-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.morph-item h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.morph-item p {
    font-size: 12px;
    opacity: 0.8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.add-morph-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-morph-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

/* Detail View */
.detail-view {
    flex: 1;
    background: #1a1a1a;
    border-radius: 12px;
    padding: 30px;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid #2a2a2a;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
}

.empty-state svg {
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 18px;
}

.morph-detail {
    height: 100%;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #2a2a2a;
}

.detail-header h2 {
    font-size: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.btn-secondary, .btn-danger {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary {
    background: #2a2a2a;
    color: #e0e0e0;
}

.btn-secondary:hover {
    background: #3a3a3a;
    transform: translateY(-2px);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

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

.detail-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.image-section {
    background: #0f0f0f;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #2a2a2a;
}

.image-section h3 {
    margin-bottom: 15px;
    color: #667eea;
    font-size: 20px;
}

.image-container {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    background: #0f0f0f;
    border: 1px solid #2a2a2a;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-container img {
    max-width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.image-container img:hover {
    transform: scale(1.02);
}

.commands-section, .notes-section {
    background: #0f0f0f;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #2a2a2a;
}

.commands-section h3, .notes-section h3 {
    margin-bottom: 15px;
    color: #667eea;
    font-size: 20px;
}

.commands-content {
    white-space: pre-wrap;
    line-height: 1.6;
    color: #e0e0e0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.notes-content {
    white-space: pre-wrap;
    line-height: 1.6;
    color: #e0e0e0;
    font-size: 14px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #1a1a1a;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid #2a2a2a;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-header h2 {
    font-size: 24px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 32px;
    color: white;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #e0e0e0;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #2a2a2a;
    background: #0f0f0f;
    color: #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group textarea {
    resize: vertical;
    font-family: 'Courier New', monospace;
}

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

.form-group input[type="file"] {
    padding: 10px;
    cursor: pointer;
}

.image-preview {
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
    max-width: 200px;
    border: 1px solid #2a2a2a;
}

.image-preview img {
    width: 100%;
    display: block;
}

.remove-image-btn {
    margin-top: 10px;
    padding: 8px 16px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.remove-image-btn:hover {
    background: #dc2626;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
}

.btn-primary {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0f0f0f;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Auth forms specific styles */
.auth-note {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
    font-style: italic;
}
