/* Root Variables - Modern Theme (Default) */
:root {
    --bg-color: #f0f2f5;
    --header-bg: #ffffff;
    --header-text: #050505;
    --header-height: 60px;
    --sidebar-bg: transparent;
    --card-bg: #ffffff;
    --text-primary: #050505;
    --text-secondary: #65676b;
    --link-color: #1877f2;
    --link-hover: #166fe5;
    --btn-primary-bg: #1877f2;
    --btn-primary-text: #ffffff;
    --border-color: #ced0d4;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --input-bg: #f0f2f5;
    --nav-hover: #f2f2f2;
}

/* Retro Theme (Classic) */
[data-theme="retro"] {
    --bg-color: #d4dded;
    /* Classic Light Blue */
    --header-bg: #b0c4de;
    /* Classic Header Blue */
    --header-text: #000000;
    --header-height: 50px;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-primary: #000000;
    --text-secondary: #666666;
    --link-color: #0055cc;
    /* Classic Link Blue */
    --link-hover: #003399;
    --btn-primary-bg: #6fa8dc;
    --btn-primary-text: #ffffff;
    --border-color: #b0c4de;
    --shadow: none;
    --radius: 0px;
    /* Square corners */
    --input-bg: #ffffff;
    --nav-hover: #e8eef7;
}

/* Blue Theme */
[data-theme="blue"] {
    --bg-color: #e3f2fd;
    --header-bg: #1565c0;
    --header-text: #ffffff;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-primary: #0d47a1;
    --text-secondary: #1976d2;
    --link-color: #1565c0;
    --link-hover: #0d47a1;
    --btn-primary-bg: #1976d2;
    --btn-primary-text: #ffffff;
    --border-color: #90caf9;
    --shadow: 0 2px 4px rgba(21, 101, 192, 0.15);
    --radius: 8px;
    --input-bg: #e3f2fd;
    --nav-hover: #bbdefb;
}

/* Pink Theme */
[data-theme="pink"] {
    --bg-color: #fce4ec;
    --header-bg: #e91e63;
    --header-text: #ffffff;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-primary: #880e4f;
    --text-secondary: #c2185b;
    --link-color: #e91e63;
    --link-hover: #c2185b;
    --btn-primary-bg: #e91e63;
    --btn-primary-text: #ffffff;
    --border-color: #f48fb1;
    --shadow: 0 2px 4px rgba(233, 30, 99, 0.15);
    --radius: 12px;
    --input-bg: #fce4ec;
    --nav-hover: #f8bbd9;
}

/* Green Theme */
[data-theme="green"] {
    --bg-color: #e8f5e9;
    --header-bg: #2e7d32;
    --header-text: #ffffff;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-primary: #1b5e20;
    --text-secondary: #388e3c;
    --link-color: #2e7d32;
    --link-hover: #1b5e20;
    --btn-primary-bg: #43a047;
    --btn-primary-text: #ffffff;
    --border-color: #a5d6a7;
    --shadow: 0 2px 4px rgba(46, 125, 50, 0.15);
    --radius: 8px;
    --input-bg: #e8f5e9;
    --nav-hover: #c8e6c9;
}

/* Purple Theme */
[data-theme="purple"] {
    --bg-color: #ede7f6;
    --header-bg: #7b1fa2;
    --header-text: #ffffff;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-primary: #4a148c;
    --text-secondary: #8e24aa;
    --link-color: #7b1fa2;
    --link-hover: #4a148c;
    --btn-primary-bg: #9c27b0;
    --btn-primary-text: #ffffff;
    --border-color: #ce93d8;
    --shadow: 0 2px 4px rgba(123, 31, 162, 0.15);
    --radius: 10px;
    --input-bg: #ede7f6;
    --nav-hover: #e1bee7;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-color: #121212;
    --header-bg: #1e1e1e;
    --header-text: #ffffff;
    --sidebar-bg: #1e1e1e;
    --card-bg: #1e1e1e;
    --text-primary: #e0e0e0;
    --text-secondary: #9e9e9e;
    --link-color: #bb86fc;
    --link-hover: #e1bee7;
    --btn-primary-bg: #bb86fc;
    --btn-primary-text: #000000;
    --border-color: #333333;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    --radius: 8px;
    --input-bg: #2d2d2d;
    --nav-hover: #333333;
}

/* Ocean Theme */
[data-theme="ocean"] {
    --bg-color: #e0f7fa;
    --header-bg: #006064;
    --header-text: #ffffff;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-primary: #004d40;
    --text-secondary: #00796b;
    --link-color: #00838f;
    --link-hover: #006064;
    --btn-primary-bg: #0097a7;
    --btn-primary-text: #ffffff;
    --border-color: #80deea;
    --shadow: 0 2px 4px rgba(0, 96, 100, 0.15);
    --radius: 8px;
    --input-bg: #e0f7fa;
    --nav-hover: #b2ebf2;
}

/* Sunset Theme */
[data-theme="sunset"] {
    --bg-color: #fff3e0;
    --header-bg: linear-gradient(135deg, #ff6f00, #e91e63);
    --header-text: #ffffff;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-primary: #e65100;
    --text-secondary: #f57c00;
    --link-color: #ff5722;
    --link-hover: #e64a19;
    --btn-primary-bg: linear-gradient(135deg, #ff6f00, #e91e63);
    --btn-primary-text: #ffffff;
    --border-color: #ffcc80;
    --shadow: 0 2px 4px rgba(255, 111, 0, 0.15);
    --radius: 12px;
    --input-bg: #fff3e0;
    --nav-hover: #ffe0b2;
}

/* Custom Theme (for premium users with custom color) */
[data-theme="custom"] {
    --bg-color: var(--custom-bg, #f0f2f5);
    --header-bg: var(--custom-primary, #1877f2);
    --header-text: #ffffff;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-primary: var(--custom-text, #050505);
    --text-secondary: var(--custom-secondary, #65676b);
    --link-color: var(--custom-primary, #1877f2);
    --link-hover: var(--custom-hover, #166fe5);
    --btn-primary-bg: var(--custom-primary, #1877f2);
    --btn-primary-text: #ffffff;
    --border-color: var(--custom-border, #ced0d4);
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --input-bg: var(--custom-bg, #f0f2f5);
    --nav-hover: var(--custom-hover-bg, #f2f2f2);
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    padding-top: var(--header-height);
    /* Prevent content hiding behind fixed header */
}

[data-theme="retro"] body {
    font-family: 'Verdana', sans-serif;
    font-size: 11px;
    /* Smaller font for retro feel */
}

a {
    color: var(--link-color);
    text-decoration: none;
    cursor: pointer;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Header */
.classic-header {
    background-color: var(--header-bg);
    height: var(--header-height);
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 1rem;
}

.logo {
    color: #db7093;
    /* Brand Pink */
    font-weight: bold;
    font-size: 1.5rem;
    text-decoration: none;
    margin-right: 2rem;
}

.logo:hover {
    text-decoration: none;
    color: #c75c80;
}

.nav-link {
    color: var(--header-text);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: background-color 0.2s;
}

.nav-link:hover {
    background-color: var(--nav-hover);
    text-decoration: none;
    color: var(--link-color);
}

[data-theme="retro"] .nav-link {
    color: #0044cc;
    font-weight: normal;
}

/* Layout Grid */
.layout-container {
    display: grid;
    grid-template-columns: 220px 1fr 260px;
    /* Left Sidebar, Main, Right Sidebar */
    gap: 1rem;
    max-width: 1400px;
    width: 100%;
    margin: 1rem auto;
    padding: 0 1rem;
    box-sizing: border-box;
}

/* Sidebar alignment */
.layout-container .left-sidebar,
.layout-container .right-sidebar {
    align-self: start;
}

/* Content area - consistent width across all pages */
.layout-container .content {
    min-width: 0; /* Prevent overflow */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    flex: 1;
    align-self: start;
}

/* Force all direct children of content to fill width */
.layout-container .content > * {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
}

/* Ensure card-box always fills available width */
.layout-container .content .card-box {
    width: 100% !important;
    max-width: 100%;
}

/* Fix Bootstrap row to fill width properly - remove negative margins */
.layout-container .content > .row,
.layout-container .content .row {
    width: 100% !important;
    max-width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Ensure columns inside content rows behave properly */
.layout-container .content .row > [class*="col-"] {
    box-sizing: border-box;
}

@media (max-width: 992px) {
    .layout-container {
        grid-template-columns: 200px 1fr;
        gap: 0.75rem;
        max-width: 100%;
    }

    .right-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .layout-container {
        grid-template-columns: 1fr;
    }

    .left-sidebar {
        display: none;
    }
}

/* Components */
.card-box {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.875rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow);
}

[data-theme="retro"] .card-box {
    border: 1px solid #b4c6e1;
    margin-bottom: 5px;
    font-size: 11px;
}

/* User-generated content - images and embeds */
.card-box img:not(.rounded-circle):not(.profile-pic):not([class*="avatar"]) {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 0.5rem 0;
    display: block;
}

.card-box iframe {
    max-width: 100%;
    border-radius: 4px;
    margin: 0.5rem 0;
}

/* Quill editor content styles */
.ql-editor img {
    max-width: 100%;
    height: auto;
}

.ql-editor iframe {
    max-width: 100%;
}

h3,
h4,
h5,
h6 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

[data-theme="retro"] h3,
[data-theme="retro"] h4,
[data-theme="retro"] h5 {
    color: #bd5a7d;
    /* Pinkish headers */
    font-weight: bold;
    font-size: 1.1em;
}

/* Profile Sidebar */
.profile-card {
    text-align: center;
}

.profile-img {
    width: 100%;
    max-width: 200px;
    height: auto;
    aspect-ratio: 350/500;
    /* Default 350x500 Ratio */
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

[data-theme="retro"] .profile-img {
    border: 1px solid #ccc;
    padding: 2px;
    background: #fff;
    border-radius: 0;
}

/* Community Images */
.community-img {
    width: 100%;
    aspect-ratio: 16/9;
    /* Paisagem 16:9 */
    object-fit: cover;
    border-radius: var(--radius);
}

[data-theme="retro"] .community-img {
    border: 1px solid #ccc;
    padding: 2px;
    background: #fff;
    border-radius: 0;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    display: block;
    padding: 0.5rem;
    border-radius: var(--radius);
    color: var(--text-secondary);
}

.sidebar-menu a:hover {
    background-color: var(--nav-hover);
    color: var(--link-color);
    text-decoration: none;
}

[data-theme="retro"] .sidebar-menu a {
    color: #0055cc;
    padding: 2px 0;
    border-radius: 0;
}

[data-theme="retro"] .sidebar-menu a:hover {
    background-color: transparent;
    text-decoration: underline;
}

/* Feed & Posts */
.post-item {
    padding-bottom: 1rem;
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 0.75rem;
}

[data-theme="retro"] .post-avatar {
    border-radius: 0;
}

.post-content {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

[data-theme="retro"] .post-content {
    font-size: 11px;
}

/* Login Page Styles */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--bg-color);
    padding-top: 0;
    /* Override body padding */
}

.login-box {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.login-box .card-box {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

[data-theme="retro"] .login-box .card-box {
    background: #fcfcfc;
    border: 1px solid #b0c4de;
    border-radius: 0;
    box-shadow: none;
}

/* Tema Moderno - Login com visual contemporâneo */
[data-theme="modern"] .login-wrapper,
:not([data-theme="retro"]) .login-wrapper {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

[data-theme="modern"] .login-box .card-box,
:not([data-theme="retro"]) .login-box .card-box {
    background: #ffffff;
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 2rem;
}

[data-theme="modern"] .login-box .btn-primary,
:not([data-theme="retro"]) .login-box .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

[data-theme="modern"] .login-box .btn-primary:hover,
:not([data-theme="retro"]) .login-box .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

[data-theme="modern"] .login-box .form-control,
:not([data-theme="retro"]) .login-box .form-control {
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e0e0e0;
}

[data-theme="modern"] .login-box .form-control:focus,
:not([data-theme="retro"]) .login-box .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-logo {
    color: #db7093;
    font-size: 2.5rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 1.5rem;
    display: block;
}

/* Form Controls */
.form-control,
.form-select {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--link-color);
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.2);
}

[data-theme="retro"] .form-control,
[data-theme="retro"] .form-select {
    border-radius: 0;
    font-size: 11px;
}

/* Buttons */
.btn {
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--btn-primary-bg);
    border-color: var(--btn-primary-bg);
    color: var(--btn-primary-text);
}

.btn-primary:hover {
    background-color: var(--link-hover);
    border-color: var(--link-hover);
}

.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-outline-secondary:hover {
    background-color: var(--nav-hover);
    color: var(--text-primary);
}

[data-theme="retro"] .btn {
    border-radius: 0;
    font-weight: normal;
    font-size: 11px;
}

/* Utilities */
.text-muted {
    color: var(--text-secondary) !important;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

/* Image Aspect Ratios (Client Request) */
.img-ratio-sm {
    aspect-ratio: 350/500;
    object-fit: cover;
}

.img-ratio-md {
    aspect-ratio: 350/650;
    object-fit: cover;
}

.img-ratio-lg {
    aspect-ratio: 350/770;
    object-fit: cover;
}

/* Rich Text Editor Fix */
.ql-editor {
    min-height: 200px;
    background-color: #ffffff;
}

/* Erro de rodapé oculto por padrão para evitar falso positivo */
#blazor-error-ui {
    display: none;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

/* Modal com marca d'água da logo */
.modal-watermark {
    position: relative;
    background-color: #ffffff;
}

.modal-watermark::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background-image: url('/images/logo-repluggar.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.10;
    pointer-events: none;
    z-index: 0;
}

.modal-watermark > * {
    position: relative;
    z-index: 1;
}

/* Utility Classes */
.cursor-pointer {
    cursor: pointer;
}

.cursor-pointer:hover {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

/* Profile Stats */
.stat-box.cursor-pointer:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}