/* PORTFOLIO CSS Used across all pages */

/* =========================
   BASE STYLES
   All pages
   ========================= */

body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #111111;
    background-color: #ffffff;
}

.no-transitions,
.no-transitions * {
    transition: none !important;
}

html.dark body {
    background-color: #000000;
    color: #ffffff;
}

.bg-gray-50, .bg-white { 
    background-color: #ffffff; 
}

body.ready {
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* Light Mode Text Colors - All pages */
.text-gray-900 { 
    color: #000000 !important; 
    transition: color 0.3s ease;
}

.text-gray-700 { 
    color: #222222 !important; 
    transition: color 0.3s ease;
}

.text-gray-600 { 
    color: #333333 !important; 
    transition: color 0.3s ease;
}

.text-gray-500 { 
    color: #444444 !important; 
    transition: color 0.3s ease;
}

/* Light Mode Backgrounds - All pages */
.bg-gray-50, .bg-white { 
    background-color: #ffffff !important; 
}

/* =========================
   ANIMATIONS
   All pages
   ========================= */
.fade-in { animation: fadeIn 0.6s ease-out forwards; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scroll-left {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* =========================
   UI COMPONENTS
   ========================= */

/* Hover Lift Effect Fix */
.hover-lift { 
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease, border-color 0.2s ease;
    will-change: transform;
}

.hover-lift:hover { 
    transform: translateY(-5px) !important; 
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.dark .hover-lift:hover {
    box-shadow: 0 10px 25px -5px rgba(255, 255, 255, 0.1);
    border-color: #444444 !important;
}

.text-gray-900, .text-gray-700, .text-gray-600, .text-gray-500 {
    transition: none; 
}

/* Domain Link Buttons - index.html, projects.html */
.domain-link-button {
    display: block;
    width: fit-content;
    padding: 4px 10px;
    margin-top: 12px;
    background-color: #f8f9fa;
    color: #495057;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.domain-link-button:hover { 
    background-color: #e9ecef;
}

/* Tech Tags - tech-stack.html */
.tech-tag {
    border: 1px solid #e5e7eb;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    background: #ffffff;
}

/* Icon Alignment - index.html */
.icon-align-fix { 
    position: relative; 
    top: 2px; 
}

/* All icons and SVGs - smooth transition for dark mode */
i, svg {
    transition: color 0.3s ease, fill 0.3s ease;
}

.dark .bg-black {
    background-color: #ffffff !important;
    color: #000000 !important;
}

.dark .bg-black i {
    color: #000000 !important;
}

.dark .bg-black span {
    color: #000000 !important;
}

/* Navigation Links - community.php */
.nav-link:hover { 
    color: #000000 !important; 
}

.nav-link-inactive {
    color: #f9fafb !important;
    border-bottom: 2px solid transparent;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.nav-link-inactive:hover {
    color: #d1d5db !important;
}

.nav-link-active {
    color: #000000 !important; 
    border-bottom: 2px solid #000000 !important;
    transition: color 0.3s ease, border-color 0.3s ease;
}

/* Profile Group Mobile Centering - index.html */
.profile-group-center-on-mobile { 
    align-items: center; 
}

@media (min-width: 768px) {
    .profile-group-center-on-mobile { 
        align-items: flex-start; 
    }
}

/* =========================
   TIMELINE / EXPERIENCE
   index.html
   ========================= */
.experience-dot {
    border: 2px solid #d1d5db; 
    background-color: transparent; 
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.experience-dot.current {
    background-color: #1f2937 !important; 
    border-color: #1f2937 !important;
}

.experience-item:hover .experience-dot:not(.current) {
    background-color: #d1d5db;
    border-color: #d1d5db;
}

/* =========================
   CAROUSEL / RECOMMENDATIONS
   index.html
   ========================= */
.rec-item {
    display: none;
    opacity: 0;
}

.rec-item.active {
    display: block;
    opacity: 1;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #d1d5db;
}

.carousel-dot.active {
    background-color: #111827;
    width: 16px;
}

/* =========================
   IMAGE TRACK (Infinite Scroll)
   index.html
   ========================= */
.image-track {
    animation: scroll-left 20s linear infinite;
    min-width: 200%; 
}

.image-track:hover { 
    animation-play-state: paused; 
}

/* =========================
   PAGINATION
   certifications.html, projects.html
   ========================= */
#pagination-numbers button {
    background-color: transparent;
    color: #9ca3af;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

#pagination-numbers button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

#pagination-numbers button.active {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-color: #000000 !important;
    font-weight: 700 !important;
}

/* Navigation Buttons - certifications.html, projects.html */
.btn-no-color {
    background-color: transparent !important;
    border: 1px solid #d1d5db;
    transition: all 0.2s ease;
}

.btn-no-color:hover:not(:disabled) {
    background-color: rgba(0, 0, 0, 0.05) !important;
}

button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* =========================
   BUTTONS
   ========================= */

/* Icon Buttons - community.php */
.icon-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    background-color: transparent;
}

.icon-btn:hover { 
    background-color: #f3f4f6 !important; 
}

/* Register/Submit/Publish Buttons - community.php, create_post.php */
.register-btn,
.submit-btn,
.btn-publish {
    background-color: #000000 !important;
    color: #ffffff !important;
    border: 1px solid #000000;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.register-btn i { 
    color: #ffffff !important; 
    transition: color 0.3s ease;
}

/* Cancel/Logout Buttons - community.php, create_post.php */
.cancel-btn,
.logout-btn,
.btn-cancel {
    background-color: transparent;
    color: #9ca3af;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.cancel-btn:hover,
.logout-btn:hover,
.btn-cancel:hover {
    background-color: #f3f4f6;
    color: #000000;
}

/* =========================
   PROFILE COMPONENTS
   community.php
   ========================= */
.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #4b5563; 
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: white;
    margin: 0 auto 16px;
}

.profile-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.profile-info-item:last-child { 
    border-bottom: none; 
}

.profile-info-item i {
    width: 16px;
    text-align: center;
    color: #6b7280;
}

/* =========================
   ROLE SELECTION
   community.php
   ========================= */
.role-option {
    transition: all 0.2s;
    background-color: #ffffff;
}

.role-option:hover { 
    border-color: #666666 !important; 
}

.role-option:has(input:checked) {
    border-color: #000000 !important;
    background-color: #000000 !important;
}

.role-option:has(input:checked) i, 
.role-option:has(input:checked) span { 
    color: #ffffff !important; 
}

.role-icon,
.role-text { 
    color: #000000; 
}

/* =========================
   FORM INPUTS
   ========================= */

/* Filter Divider - community.php */
.filter-divider { 
    border-bottom: 1px solid #e5e7eb !important; 
}

/* Create Post Input - community.php */
.create-post-input {
    background-color: #f3f4f6 !important; 
    color: #4b5563 !important; 
}

/* Error Messages - community.php */
.error-message {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* Loading Spinner - community.php */
.loading-spinner { 
    display: none; 
    width: 16px; 
    height: 16px; 
    border: 2px solid #ccc; 
    border-top-color: #000; 
    border-radius: 50%; 
    animation: spin 0.8s linear infinite; 
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin-once {
    animation: spin 0.6s linear;
}

/* =========================
   MODALS
   community.php
   ========================= */
.modal { 
    display: none; 
    position: fixed; 
    /* Force it to the absolute top and left of the browser */
    top: 0;
    left: 0;
    /* Use inset: 0 to anchor it to all edges */
    inset: 0; 
    width: 100vw; 
    height: 100vh; 
    background-color: rgba(0, 0, 0, 0.6); 
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    /* Set z-index higher than any possible header */
    z-index: 99999; 
}

.modal.active { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

/* Sign In Card - community.php */
.signin-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    padding: 32px;
    position: relative;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.signin-card label,
.signin-card h2 { 
    color: #000000; 
    transition: color 0.3s ease;
}

.signin-card p { 
    color: #6b7280; 
    transition: color 0.3s ease;
}

.signin-card .close-btn {
    color: #000000;
    transition: color 0.3s ease;
}

.signin-card .close-btn:hover { 
    color: #333333; 
}

/* Register Card - community.php */
.register-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    padding: 32px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.register-card label,
.register-card h2 { 
    color: #000000; 
    transition: color 0.3s ease;
}

.register-card p { 
    color: #6b7280; 
    transition: color 0.3s ease;
}

.register-card .close-btn {
    color: #000000;
    transition: color 0.3s ease;
}

.register-card .close-btn:hover { 
    color: #333333; 
}

/* --- MODAL INPUTS --- */
.signin-input, 
.register-input,
.input-field {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background-color: #ffffff;
    color: #111111;
    margin-top: 0 !important; 
    transition: all 0.2s ease;
}

input::-ms-reveal,
input::-ms-clear {
    display: none !important;
}

input::-webkit-contacts-auto-fill-button,
input::-webkit-credentials-auto-fill-button {
    display: none !important;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-top: 8px; 
    width: 100%;
}

.password-wrapper i[class*="toggle-"] {
    position: absolute;
    right: 14px;
    top: 50% !important;
    transform: translateY(-50%) !important;
    cursor: pointer;
    color: #6b7280;
    z-index: 20;
    background: transparent;
    transition: color 0.3s ease;
}

.password-wrapper i[class*="toggle-"]:hover {
    color: #374151;
}


.signin-input, 
.register-input {
    padding-right: 45px !important;
}

/* --- BROWSER AUTOFILL FIX --- */

/* Light Mode Autofill */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus {
    -webkit-text-fill-color: #111111;
    -webkit-box-shadow: 0 0 0px 1000px #ffffff inset;
    transition: background-color 5000s ease-in-out 0s;
}

/* Dark Mode Autofill */
.dark input:-webkit-autofill,
.dark input:-webkit-autofill:hover, 
.dark input:-webkit-autofill:focus {
    -webkit-text-fill-color: #ffffff !important;
    -webkit-box-shadow: 0 0 0px 1000px #1a1a1a inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Modal Footer - community.php */
.modal-footer-text { 
    color: #6b7280; 
    transition: color 0.3s ease;
}

.modal-footer-link {
    color: #000000;
    font-weight: 700;
    transition: color 0.3s ease;
}

.modal-footer-link:hover {
    color: #333333;
    text-decoration: underline;
}

/* =========================
   UTILITY CLASSES
   All pages
   ========================= */
.hidden { 
    display: none !important; 
}

/* =========================
   DARK MODE
   All pages
   ========================= */

/* Base Dark Mode Styles */
.dark body,
.dark header,
.dark section,
.dark article,
.dark footer,
.dark .bg-white,
.dark .bg-gray-50,
.dark .cert-card,
.dark .project-card,
.dark .rec-item {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-color: #333333 !important;
}

/* Dark Mode Text */
.dark h1,
.dark h2,
.dark h3,
.dark p,
.dark span,
.dark i,
.dark a,
.dark .text-gray-900,
.dark .text-gray-700,
.dark .text-gray-600 {
    color: #ffffff !important;
}

.dark .text-gray-500 { 
    color: #cccccc !important; 
}

/* Dark Mode Borders */
.dark .border-gray-100,
.dark .border-gray-200,
.dark .border-gray-300 {
    border-color: #555555 !important;
}

/* Dark Mode Component Overrides */
.dark .bg-black { 
    background-color: #ffffff !important; 
    color: #000000 !important; 
}

.dark .bg-gray-100,
.dark .bg-gray-300 { 
    background-color: #333333 !important; 
}

/* Dark Mode Links */
.dark .back-link,
.dark .back-link i,
.dark .back-link span {
    color: #ffffff !important;
}

.dark .nav-link:hover { 
    color: #ffffff !important; 
}

.dark .nav-link-inactive {
    color: #1f2937 !important; 
}

/* Dark Mode Buttons */
.dark .domain-link-button {
    background-color: #2c2c2c !important;
    color: #ffffff !important;
    border-color: #444444 !important;
}

.dark .tech-tag {
    border-color: #444444 !important;
    color: #ffffff !important;
    background-color: transparent !important;
}

.dark .btn-no-color {
    border-color: #555555;
    color: #ffffff;
}

.dark .btn-no-color:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.dark .icon-btn { 
    border-color: #444444 !important; 
}

.dark .icon-btn:hover { 
    background-color: #1a1a1a !important; 
}

.dark .icon-btn i, 
.dark .icon-btn svg { 
    color: #ffffff !important; 
}

.dark .register-btn,
.dark .submit-btn,
.dark .btn-publish {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-color: #ffffff;
}

.dark .register-btn i { 
    color: #000000 !important; 
}

.dark .cancel-btn,
.dark .logout-btn,
.dark .btn-cancel {
    color: #ffffff;
    border-color: #444444;
}

.dark .cancel-btn:hover,
.dark .logout-btn:hover,
.dark .btn-cancel:hover {
    background-color: #1a1a1a;
    color: #ffffff;
}

/* Dark Mode Hover Effects */
.dark .hover-lift:hover {
    box-shadow: 0 10px 25px -5px rgba(255, 255, 255, 0.05);
}

/* Dark Mode Experience Timeline */
.dark .experience-dot.current { 
    background-color: #ffffff !important; 
    border-color: #ffffff !important; 
}

.dark .experience-item:hover .experience-dot:not(.current) {
    background-color: #cccccc !important;
    border-color: #cccccc !important;
}

/* Dark Mode Carousel */
.dark .carousel-dot {
    background-color: #4b5563;
}

.dark .carousel-dot.active {
    background-color: #ffffff;
}

/* Dark Mode Pagination */
.dark #pagination-numbers button {
    background-color: transparent;
    color: #6b7280;
    border-color: #374151;
}

.dark #pagination-numbers button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.dark #pagination-numbers button.active {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-color: #ffffff !important;
}

/* Dark Mode Images */
.dark .image-track img,
.dark img {
    opacity: 0.9;
}

/* Dark Mode Profile Components */
.dark .profile-avatar {
    background: #374151;
    color: #ffffff;
}

.dark .profile-info-item { 
    border-bottom-color: #1a1a1a; 
}

.dark .profile-info-item i { 
    color: #9ca3af !important; 
}

/* Dark Mode Role Selection */
.dark .role-option { 
    background-color: #1a1a1a !important; 
}

.dark .role-option:hover { 
    border-color: #999999 !important; 
}

.dark .role-option:has(input:checked) {
    border-color: #ffffff !important;
    background-color: #ffffff !important;
}

.dark .role-option:has(input:checked) i, 
.dark .role-option:has(input:checked) span { 
    color: #000000 !important; 
}

.dark .role-icon,
.dark .role-text { 
    color: #ffffff !important; 
}

/* Dark Mode Dividers */
.dark .filter-divider { 
    border-bottom-color: #333333 !important; 
}

/* Dark Mode Inputs */
.dark .create-post-input,
.dark .input-field {
    background-color: #f9fafb !important;
    color: #4b5563 !important;
    border-color: #e5e7eb !important;
}

.dark .signin-input, 
.dark .register-input {
    background-color: #1a1a1a !important;
    border-color: #444444 !important;
    color: #ffffff !important;
}

.dark .signin-input::placeholder, 
.dark .register-input::placeholder { 
    color: #6b7280 !important; 
}

/* Dark Mode Password Toggle */
.dark .toggle-password, 
.dark .toggle-password-register { 
    color: #9ca3af !important; 
}

.dark .toggle-password:hover, 
.dark .toggle-password-register:hover { 
    color: #d1d5db !important; 
}

/* Dark Mode Modals */
.dark .signin-card,
.dark .register-card {
    background-color: #000000 !important;
    border-color: #333333 !important;
}

.dark .signin-card label, 
.dark .register-card label,
.dark .signin-card h2, 
.dark .register-card h2 { 
    color: #ffffff !important; 
}

.dark .signin-card p, 
.dark .register-card p { 
    color: #9ca3af !important; 
}

.dark .signin-card .close-btn, 
.dark .register-card .close-btn { 
    color: #ffffff !important; 
}

.dark .signin-card .close-btn:hover, 
.dark .register-card .close-btn:hover { 
    color: #e5e7eb !important; 
}

/* Dark Mode Modal Footer */
.dark .modal-footer-text { 
    color: #9ca3af !important; 
}

.dark .modal-footer-link { 
    color: #ffffff !important; 
}

.dark .modal-footer-link:hover { 
    color: #e5e7eb !important; 
}

/* Dark Mode Error Messages */
.dark .error-message {
    background-color: #7f1d1d;
    border-color: #991b1b;
    color: #fecaca;
}

/* Dark Mode Loading Spinner */
.dark .loading-spinner { 
    border-top-color: #fff; 
}

/* Notifications */
.notification-center {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 320px;
    padding: 2.5rem;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    z-index: 10000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    animation: notifyPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.notification-success {
    background: rgba(16, 185, 129, 0.95); /* Emerald */
    color: white;
}

.notification-error {
    background: rgba(239, 68, 68, 0.95); /* Red */
    color: white;
}

@keyframes notifyPop {
    from { opacity: 0; transform: translate(-50%, -45%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.icon-circle {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

/* Keep articles visible */
article.hover-lift {
    overflow: visible !important;
}


[id^="post-dropdown-"] {
    z-index: 100 !important;
}

article, .post-card {
    overflow: visible !important;
}

[id^="post-dropdown-"] {
    z-index: 9999 !important;
    position: absolute;
    transform: translate3d(0, 0, 0); 
}

.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px; 
    z-index: 1000; 
}