/* assets/css/profile.css */

.profile-wrapper {
    max-width: 900px;
    margin: 0 auto;
    font-family: 'Inter', sans-serif;
    color: #333;
}

/* Glassmorphism Card */
.profile-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.dark .profile-card {
    background: rgba(17, 24, 39, 0.7);
    color: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Avatar Display */
.avatar-container {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 20px;
    overflow: hidden;
    position: relative;
    border: 4px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background-color: #f0f0f0;
}

.avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Fallback */
    display: block;
    transform-origin: center center;
    /* Transformation applied inline from DB settings */
}

/* Text Styling */
.profile-username {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.profile-bio {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    opacity: 0.9;
}

.profile-website {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.profile-website:hover {
    background: rgba(139, 92, 246, 0.2);
    transform: translateY(-2px);
}

.btn-edit-profile {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-edit-profile:hover {
    background: #2563eb;
}

/* TOS Section */
.tos-section {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.dark .tos-section {
    background: rgba(17, 24, 39, 0.5);
}

.tos-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
}

.markdown-body {
    text-align: left;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.dark .modal-content {
    background-color: #1f2937;
    border-color: #374151;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* Avatar Editor */
.avatar-editor-mask {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin: 20px auto;
    overflow: hidden;
    position: relative;
    border: 2px dashed #ccc;
    cursor: grab;
    background: #eee;
}

.avatar-editor-mask img {
    /* Initially center it? */
    display: block;
    max-width: none;
    /* Allow scaling beyond container */
    transform-origin: center center;
}

.editor-controls {
    text-align: center;
    margin: 20px 0;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #f9f9f9;
}

.dark .form-group input,
.dark .form-group textarea {
    background: #374151;
    border-color: #4b5563;
    color: #fff;
}

.toolbar {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
}

.toolbar button {
    padding: 4px 8px;
    background: #e5e7eb;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.dark .toolbar button {
    background: #4b5563;
    color: white;
}

/* Markdown Content Styling */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
    line-height: 1.25;
    color: inherit;
}

.markdown-body h1 { font-size: 2em; border-bottom: 1px solid #eaecef; padding-bottom: 0.3em; }
.markdown-body h2 { font-size: 1.5em; border-bottom: 1px solid #eaecef; padding-bottom: 0.3em; }
.markdown-body h3 { font-size: 1.25em; }
.markdown-body h4 { font-size: 1em; }

.markdown-body p { margin-bottom: 1em; line-height: 1.6; }
.markdown-body ul, .markdown-body ol { padding-left: 2em; margin-bottom: 1em; }
.markdown-body ul { list-style-type: disc; }
.markdown-body ol { list-style-type: decimal; }

.markdown-body a { color: #8b5cf6; text-decoration: none; }
.markdown-body a:hover { text-decoration: underline; }
.markdown-body strong { font-weight: bold; }
.markdown-body em { font-style: italic; }

.markdown-body blockquote {
    padding: 0 1em;
    color: #6a737d;
    border-left: 0.25em solid #dfe2e5;
    margin: 0 0 1em 0;
}

.markdown-body code {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background-color: rgba(27,31,35,0.05);
    border-radius: 3px;
    font-family: monospace;
}

.markdown-body pre {
    padding: 16px;
    overflow: auto;
    font-size: 85%;
    line-height: 1.45;
    background-color: #f6f8fa;
    border-radius: 3px;
    margin-bottom: 1em;
}
.markdown-body pre code { background-color: transparent; }

/* Dark Mode Markdown Overrides */
.dark .markdown-body { color: #e5e7eb; }
.dark .markdown-body h1, .dark .markdown-body h2 { border-color: #374151; }
.dark .markdown-body a { color: #a78bfa; }
.dark .markdown-body blockquote { color: #9ca3af; border-left-color: #4b5563; }
.dark .markdown-body code { background-color: rgba(110, 118, 129, 0.4); color: #e5e7eb; }
.dark .markdown-body pre { background-color: #1f2937; color: #e5e7eb; }