/* Discord Portfolio Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Whitney', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #36393f;
    color: #dcddde;
    overflow: hidden;
    height: 100vh;
}

.discord-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Server Sidebar */
.servers-sidebar {
    width: 72px;
    background-color: #202225;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.servers-sidebar::-webkit-scrollbar {
    display: none;
}

.server-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.server-item {
    position: relative;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    color: inherit;
}

.server-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #36393f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: #dcddde;
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
}

.server-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.server-item:hover .server-icon {
    border-radius: 16px;
    background-color: #5865f2;
    color: white;
}

.server-item.active .server-icon {
    border-radius: 16px;
    background-color: #5865f2;
    color: white;
}

.server-item.home .server-icon {
    background-color: #5865f2;
    color: white;
}

.tesla-icon {
    background: linear-gradient(135deg, #cc0000, #ff3333);
}

.whoop-icon {
    background: linear-gradient(135deg, #ff6b35, #ff8c42);
}

.ford-icon {
    background: linear-gradient(135deg, #003366, #0066cc);
}

.electrium-icon {
    background: linear-gradient(135deg, #00cc66, #33ff99);
}

.projects-icon {
    background: linear-gradient(135deg, #9146ff, #6441a4);
}

.server-separator {
    width: 32px;
    height: 2px;
    background-color: #40444b;
    border-radius: 1px;
    margin: 4px 0;
}

.server-tooltip {
    position: absolute;
    left: 60px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #18191c;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s ease;
    z-index: 1000;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.24);
}

.server-item:hover .server-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    height: 100vh;
}

/* Channels Sidebar */
.channels-sidebar {
    width: 240px;
    background-color: #2f3136;
    display: flex;
    flex-direction: column;
}

.server-header {
    padding: 20px 16px 16px;
    border-bottom: 1px solid #40444b;
    box-shadow: 0 1px 0 rgba(4, 4, 5, 0.2), 0 1.5px 0 rgba(6, 6, 7, 0.05), 0 2px 0 rgba(4, 4, 5, 0.05);
}

.server-header h3 {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
}

.channel-list {
    padding: 16px 8px;
    flex: 1;
}

.channel-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    margin: 1px 0;
    border-radius: 4px;
    cursor: pointer;
    color: #96989d;
    font-size: 16px;
    position: relative;
    transition: all 0.15s ease;
}

.channel-item:hover {
    background-color: #40444b;
    color: #dcddde;
}

.channel-item.active {
    background-color: #42464d;
    color: #ffffff;
}

.channel-item i {
    margin-right: 8px;
    color: #5865f2;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: auto;
}

.status-indicator.online {
    background-color: #3ba55c;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #36393f;
}

.chat-header {
    height: 48px;
    padding: 0 16px;
    border-bottom: 1px solid #40444b;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 0 rgba(4, 4, 5, 0.2), 0 1.5px 0 rgba(6, 6, 7, 0.05), 0 2px 0 rgba(4, 4, 5, 0.05);
}

.chat-header h3 {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.chat-header p {
    color: #b9bbbe;
    font-size: 14px;
    margin: 0;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-title i {
    color: #5865f2;
    font-size: 20px;
}

.chat-title span {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.status-text {
    font-size: 12px;
    color: #96989d;
    margin-left: 8px;
}

.messages-container {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    gap: 16px;
    padding: 2px 16px;
    margin-bottom: 16px;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #5865f2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background-color: #7289da;
}

.user-message .message-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.message-content {
    flex: 1;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.username {
    font-weight: 600;
    color: #ffffff;
    font-size: 16px;
}

.timestamp {
    font-size: 12px;
    color: #96989d;
}

.bot-tag {
    background-color: #5865f2;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 3px;
    text-transform: uppercase;
}

.message-text {
    color: #dcddde;
    line-height: 1.375;
    white-space: pre-wrap;
    text-align: left;
}

.message-input-container {
    padding: 0 16px 24px;
}

.message-input-wrapper {
    background-color: #40444b;
    border-radius: 24px;
    display: flex;
    align-items: center;
    padding: 0 16px;
}

#messageInput {
    flex: 1;
    background: none;
    border: none;
    color: #dcddde;
    font-size: 16px;
    padding: 12px 0;
    outline: none;
}

#messageInput::placeholder {
    color: #72767d;
}

#sendButton {
    background: #5865f2;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

#sendButton:hover {
    background-color: #4752c4;
}

/* User Sidebar */
.user-sidebar {
    width: 340px;
    background-color: #2f3136;
    border-left: 1px solid #40444b;
    display: flex;
    flex-direction: column;
}

.user-profile {
    padding: 16px;
    height: 100%;
    overflow-y: auto;
}

.user-banner {
    height: 120px;
    background-image: url('images/home page profile banner.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px 8px 0 0;
    margin-bottom: -20px;
    position: relative;
}

.user-avatar {
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.avatar-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5865f2, #7289da);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: 600;
    border: 6px solid #2f3136;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.status-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 4px solid #2f3136;
}

.status-badge.online {
    background-color: #3ba55c;
}

.user-info {
    margin-bottom: 24px;
}

.user-info .user-status {
    text-align: left !important;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    width: 100% !important;
    margin-left: 0 !important;
}

.user-info h2 {
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
    text-align: center;
}

.user-tag {
    color: #96989d;
    font-size: 14px;
    margin-bottom: 8px;
    text-align: center;
}

.user-status {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    font-size: 14px;
    color: #96989d;
    text-align: left !important;
    width: 100%;
    margin-left: 0;
    align-self: flex-start;
}

.user-status span {
    text-align: left !important;
    width: 100%;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-section h4 {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-section p {
    color: #dcddde;
    font-size: 14px;
    line-height: 1.5;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 14px;
    color: #dcddde;
}

.contact-item i {
    width: 16px;
    color: #96989d;
}

.contact-item a {
    color: #5865f2;
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.skill-tag {
    background-color: #5865f2;
    color: white;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 12px;
    display: inline-block;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
}

.modal-content {
    background-color: #36393f;
    margin: 5% auto;
    padding: 24px;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    color: #dcddde;
}

.close {
    color: #96989d;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 16px;
    top: 16px;
}

.close:hover {
    color: #ffffff;
}

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

::-webkit-scrollbar-track {
    background: #2f3136;
}

::-webkit-scrollbar-thumb {
    background: #40444b;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4f545c;
}

/* Server Page Specific Styles */
.server-header .server-subtitle {
    font-size: 12px;
    color: #96989d;
    margin-top: 4px;
    font-weight: 400;
}

.channel-category {
    margin-bottom: 16px;
}

.channel-category h4 {
    color: #96989d;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    padding: 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.channel-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
}

.tesla-avatar img,
.whoop-avatar img,
.ford-avatar img,
.electrium-avatar img,
.exceed-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.tesla-avatar {
    background-color: #cc0000;
}

.whoop-avatar {
    background-color: #ff6b35;
}

.ford-avatar {
    background-color: #003366;
}

.electrium-avatar {
    background-color: #00cc66;
}

.exceed-avatar {
    background-color: #ff8c00;
}

/* Code blocks in messages */
.message-text code {
    background-color: #2f3136;
    color: #f8f8f2;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 14px;
}

.message-text pre {
    background-color: #2f3136;
    color: #f8f8f2;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid #5865f2;
    margin: 8px 0;
    overflow-x: auto;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 14px;
}

/* Pinned Message Styles */
.pinned-message {
    background-color: #2f3136;
    border: 1px solid #40444b;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.pinned-icon {
    color: #faa61a;
    font-size: 14px;
    margin-top: 2px;
}

.pinned-content {
    flex: 1;
}

.pinned-header {
    margin-bottom: 4px;
}

.pinned-label {
    color: #faa61a;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pinned-text {
    color: #dcddde;
    font-size: 14px;
    line-height: 1.4;
}

/* Message Image Styles */
.message-image {
    margin-top: 8px;
    border-radius: 8px;
    overflow: hidden;
    max-width: 400px;
}

.message-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* Responsive design */
@media (max-width: 768px) {
    .user-sidebar {
        display: none;
    }
    
    .channels-sidebar {
        width: 200px;
    }
}

@media (max-width: 600px) {
    .channels-sidebar {
        width: 0;
        overflow: hidden;
    }
    
    .servers-sidebar {
        width: 60px;
    }
    
    .server-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* Animation for typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    color: #96989d;
    font-style: italic;
}

.typing-dots {
    display: flex;
    gap: 2px;
}

.typing-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #96989d;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Legal Footer */
.legal-footer {
    background-color: #1e1f22;
    border-top: 1px solid #40444b;
    padding: 20px;
    margin-top: 20px;
    font-size: 12px;
    line-height: 1.4;
}

.legal-content {
    max-width: 1200px;
    margin: 0 auto;
    color: #b9bbbe;
}

.legal-content p {
    margin-bottom: 10px;
}

.legal-content strong {
    color: #ffffff;
}

/* Hide mobile elements on desktop */
@media (min-width: 769px) {
    .mobile-user-toggle {
        display: none !important;
    }
    
    .mobile-user-profile {
        display: none !important;
    }
}

/* Mobile Responsive Design - Desktop layout preserved above 768px */

/* Tablet and Mobile Landscape */
@media (max-width: 1024px) and (orientation: landscape) {
    .user-sidebar {
        width: 250px;
    }
    
    .user-details {
        font-size: 14px;
    }
}

/* Mobile Portrait */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
        overflow-y: auto;
    }
    
    .discord-container {
        flex-direction: column;
        min-height: 100vh;
        height: auto;
    }
    
    /* Mobile Server Navigation */
    .servers-sidebar {
        width: 100%;
        height: 60px;
        flex-direction: row;
        justify-content: flex-start;
        padding: 8px 12px;
        overflow-x: auto;
        overflow-y: hidden;
        border-bottom: 1px solid #40444b;
    }
    
    .server-list {
        flex-direction: row;
        gap: 12px;
        min-width: max-content;
    }
    
    .server-item {
        flex-shrink: 0;
        width: 44px;
        height: 44px;
        margin: 0;
    }
    
    .server-separator {
        display: none;
    }
    
    .server-tooltip {
        display: none;
    }
    
    /* Main Content Area */
    .main-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    
    /* Mobile Channels Sidebar */
    .channels-sidebar {
        width: 100%;
        background-color: #2f3136;
        border-bottom: 1px solid #40444b;
        max-height: 200px;
        overflow-y: auto;
    }
    
    .server-header {
        padding: 12px 16px;
        border-bottom: 1px solid #40444b;
    }
    
    .channel-list {
        padding: 8px 0;
    }
    
    .channel-category {
        padding: 8px 16px;
        font-size: 12px;
        font-weight: 600;
        color: #8e9297;
        text-transform: uppercase;
        letter-spacing: 0.02em;
    }
    
    .channel-item {
        padding: 8px 16px;
        font-size: 14px;
        color: #8e9297;
        cursor: pointer;
        transition: background-color 0.15s ease;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .channel-item:hover {
        background-color: #3c3f44;
        color: #dcddde;
    }
    
    .channel-item.active {
        background-color: #5865f2;
        color: #ffffff;
    }
    
    .channel-item i {
        font-size: 14px;
        width: 16px;
        text-align: center;
    }
    
    /* Mobile Chat Area */
    .chat-area {
        flex: 1;
        display: flex;
        flex-direction: column;
        width: 100%;
        margin-right: 0;
        margin-bottom: 0;
        min-height: 0;
    }
    
    .chat-header {
        padding: 12px 16px;
        border-bottom: 1px solid #40444b;
    }
    
    .chat-title {
        font-size: 16px;
    }
    
    .status-text {
        font-size: 12px;
    }
    
    /* Mobile Messages */
    .messages-container {
        flex: 1;
        padding: 16px;
        overflow-y: auto;
        min-height: 200px;
        max-height: calc(100vh - 200px);
    }
    
    .message {
        margin-bottom: 16px;
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .message-content {
        margin-left: 12px;
    }
    
    .message-header {
        font-size: 14px;
        margin-bottom: 4px;
    }
    
    .message-text {
        font-size: 14px;
        line-height: 1.4;
    }
    
    /* Mobile Input */
    .message-input-container {
        padding: 12px 16px;
        border-top: 1px solid #40444b;
        background-color: #36393f;
        position: sticky;
        bottom: 0;
        z-index: 10;
    }
    
    .message-input-wrapper {
        border-radius: 20px;
    }
    
    #messageInput {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 16px;
    }
    
    #sendButton {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    /* Mobile User Profile - Collapsible */
    .user-sidebar {
        display: none; /* Hidden by default */
    }
    
    .mobile-user-toggle {
        display: none; /* Hidden by default */
        position: fixed;
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        background-color: #5865f2;
        border: none;
        border-radius: 50%;
        color: white;
        font-size: 16px;
        cursor: pointer;
        z-index: 1000;
        box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    }
    
    .mobile-user-profile {
        display: none !important;
        position: fixed;
        top: 60px;
        right: 10px;
        width: 280px;
        background-color: #2f3136;
        border-radius: 8px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.5);
        z-index: 999;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
    
    .mobile-user-profile.show {
        display: block !important;
    }
    
    .mobile-user-profile .user-profile {
        padding: 16px;
        border-radius: 8px;
    }
    
    .mobile-user-profile .user-banner {
        height: 60px;
        border-radius: 8px 8px 0 0;
    }
    
    .mobile-user-profile .user-avatar {
        margin-top: -20px;
        margin-bottom: 12px;
    }
    
    .mobile-user-profile .user-info h2 {
        font-size: 18px;
        margin-bottom: 4px;
    }
    
    .mobile-user-profile .user-tag {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .mobile-user-profile .user-status {
        margin-bottom: 16px;
    }
    
    .mobile-user-profile .detail-section {
        margin-bottom: 16px;
    }
    
    .mobile-user-profile .detail-section h4 {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .mobile-user-profile .contact-item {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .mobile-user-profile .skills-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .mobile-user-profile .skill-tag {
        font-size: 11px;
        padding: 2px 6px;
    }
    
    /* Show mobile toggle button only on mobile */
    .mobile-user-toggle {
        display: block !important;
    }
    
    /* Mobile Legal Footer */
    .legal-footer {
        padding: 16px;
        font-size: 11px;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .servers-sidebar {
        height: 50px;
        padding: 6px 8px;
    }
    
    .server-item {
        width: 38px;
        height: 38px;
    }
    
    .server-icon {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    
    .chat-header {
        padding: 10px 12px;
    }
    
    .chat-title {
        font-size: 14px;
    }
    
    .messages-container {
        padding: 12px;
    }
    
    .message-input-container {
        padding: 10px 12px;
    }
    
    #messageInput {
        font-size: 16px;
        padding: 10px 14px;
    }
}

/* Mobile Server Pages */
@media (max-width: 768px) {
    .server-header {
        padding: 12px 16px;
    }
    
    .server-title {
        font-size: 18px;
    }
    
    .server-subtitle {
        font-size: 12px;
    }
    
    .channel-category {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .channel-item {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .channel-item i {
        font-size: 14px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .server-item:hover {
        transform: none;
    }
    
    .server-item:active {
        transform: scale(0.95);
    }
    
    .message-input-wrapper:focus-within {
        box-shadow: 0 0 0 2px #5865f2;
    }
}
