/* Profile Page Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #009688;
    --primary-dark: #00796b;
    --secondary: #764ba2;
    --success: #10b981;
    --danger: #ef4444;
    --dark: #1f2937;
    --light: #f3f4f6;
    --border: #e5e7eb;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #333;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 20px 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.dashboard-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.dashboard-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    color: white;
}

/* Profile Photo */
.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.upload-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--primary) !important;
    border: none;
}

.upload-btn:hover {
    background: var(--primary-dark) !important;
}

/* Bike Card */
.bike-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 15px;
    padding: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-width: 350px;
}

.bike-image {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
}

.bike-info h2 {
    font-size: 20px;
    margin-bottom: 5px;
}

.bike-info p {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
}

/* Gallery Tabs */
.skill-card {
    border-radius: 15px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.skill-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 150, 136, 0.2) !important;
    border-color: var(--primary);
}

.skill-card[onclick]:hover {
    background: linear-gradient(135deg, rgba(0, 150, 136, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

/* Gallery Section */
.gallery-section {
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    padding: 30px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    background: #f3f4f6;
    aspect-ratio: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.15);
}

/* Notification */
.notification {
    position: fixed;
    top: 90px;
    right: 30px;
    padding: 16px 28px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    z-index: 2000;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification.success {
    background: var(--success);
}

.notification.error {
    background: var(--danger);
}

/* Login Container */
.login-container {
    max-width: 450px;
    margin: 100px auto;
}

.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    color: var(--primary);
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.1);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 150, 136, 0.3);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Messages Section */
.message-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary);
}

.message-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.message-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

.sender-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
    flex-shrink: 0;
}

.message-meta {
    flex: 1;
}

.message-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px 0;
}

.message-time {
    color: #999;
    font-size: 12px;
}

.message-content {
    color: #666;
    line-height: 1.6;
    margin-left: 60px;
    overflow-wrap: break-word;
    word-wrap: break-word;
    /* Fallback */
    word-break: break-word;
}

/* Ensure images and other content within message don't overflow */
.message-content img,
.message-content video,
.message-content iframe {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
    display: block;
}

/* Handle tables if any */
.message-content table {
    max-width: 100%;
    display: block;
    overflow-x: auto;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
}

.page-btn {
    padding: 8px 16px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #333;
}

.page-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    padding: 8px 16px;
    color: #666;
    font-weight: 600;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    font-size: 40px;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Gallery Item Actions */
.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-info {
    color: white;
    font-size: 12px;
}

.gallery-item-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.gallery-action-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.gallery-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.gallery-action-btn.delete {
    background: rgba(239, 68, 68, 0.8);
    border-color: rgba(239, 68, 68, 1);
}

.gallery-action-btn.delete:hover {
    background: rgba(239, 68, 68, 1);
}

/* Upload Section */
.upload-section {
    background: linear-gradient(135deg, rgba(0, 150, 136, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border: 2px dashed var(--primary);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    margin-bottom: 30px;
}

.upload-btn-large {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 150, 136, 0.3);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state-subtext {
    font-size: 14px;
}

/* Member Cards */
.member-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.member-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(0, 150, 136, 0.2);
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }

    .bike-card {
        min-width: 300px;
    }
}

/* Mobile Landscape & Small Tablets (481px - 768px) */
@media (max-width: 768px) {

    /* Header */
    .header {
        padding: 15px 20px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .header h1 {
        font-size: 20px;
    }

    .header-right {
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
        justify-content: center;
    }

    .user-info {
        padding: 6px 12px;
        font-size: 14px;
    }

    .dashboard-btn {
        padding: 6px 15px;
        font-size: 14px;
    }

    /* Profile Section */
    .profile-photo {
        width: 120px;
        height: 120px;
        border: 3px solid white;
    }

    .card.p-4 {
        padding: 20px !important;
    }

    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 20px;
    }

    /* Bike Card */
    .bike-card {
        min-width: 100%;
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }

    .bike-image {
        width: 100px;
        height: 70px;
    }

    .bike-info h2 {
        font-size: 18px;
    }

    /* Gallery Grid */
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }

    .gallery-section {
        padding: 20px;
    }

    /* Navigation Cards */
    .row.g-3 {
        gap: 15px !important;
    }

    .skill-card {
        min-height: 120px;
    }

    .skill-card h5 {
        font-size: 16px;
    }

    .skill-card p {
        font-size: 13px;
    }

    /* Messages */
    .message-card {
        padding: 15px;
    }

    .message-header {
        gap: 12px;
    }

    .sender-avatar {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .message-title {
        font-size: 15px;
    }

    .message-content {
        margin-left: 52px;
        font-size: 14px;
    }

    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        gap: 8px;
    }

    .page-btn {
        padding: 6px 12px;
        font-size: 14px;
    }

    .page-info {
        padding: 6px 12px;
        font-size: 14px;
    }

    /* Login */
    .login-container {
        margin: 50px auto;
        padding: 0 20px;
    }

    .login-card {
        padding: 30px 25px;
    }

    /* Notification */
    .notification {
        right: 20px;
        left: 20px;
        top: 80px;
        padding: 12px 20px;
        font-size: 14px;
    }

    /* Lightbox */
    .lightbox img {
        max-width: 95%;
        max-height: 85%;
    }

    .lightbox-close {
        top: 20px;
        right: 20px;
        font-size: 30px;
        width: 40px;
        height: 40px;
    }

    /* Upload Section */
    .upload-section {
        padding: 20px;
    }

    .upload-btn-large {
        padding: 10px 25px;
        font-size: 15px;
    }
}

/* Mobile Portrait (320px - 480px) */
@media (max-width: 480px) {

    /* Header */
    .header {
        padding: 12px 15px;
    }

    .header h1 {
        font-size: 18px;
        gap: 8px;
    }

    .header h1 span:first-child {
        font-size: 20px;
    }

    .header-right {
        gap: 8px;
    }

    .user-info {
        padding: 5px 10px;
        font-size: 13px;
        gap: 6px;
    }

    .dashboard-btn {
        padding: 5px 12px;
        font-size: 13px;
    }

    /* Container */
    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    /* Profile Section */
    .profile-photo {
        width: 100px;
        height: 100px;
    }

    .card {
        border-radius: 12px !important;
    }

    .card.p-4 {
        padding: 15px !important;
    }

    .mb-4 {
        margin-bottom: 1.5rem !important;
    }

    /* Bike Card */
    .bike-card {
        padding: 12px;
        gap: 12px;
    }

    .bike-image {
        width: 80px;
        height: 60px;
    }

    .bike-info h2 {
        font-size: 16px;
    }

    .bike-info p {
        font-size: 13px;
    }

    /* Gallery Grid */
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .gallery-section {
        padding: 15px;
    }

    .gallery-item {
        border-radius: 12px;
    }

    /* Navigation Cards */
    .skill-card {
        min-height: 100px;
        padding: 15px !important;
    }

    .skill-card div[style*="font-size: 48px"] {
        font-size: 36px !important;
        margin-bottom: 10px !important;
    }

    .skill-card h5 {
        font-size: 14px !important;
    }

    .skill-card p {
        font-size: 12px !important;
    }

    /* Messages */
    .message-card {
        padding: 12px;
        border-radius: 10px;
    }

    .message-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .sender-avatar {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .message-title {
        font-size: 14px;
    }

    .message-time {
        font-size: 11px;
    }

    .message-content {
        margin-left: 0;
        font-size: 13px;
        margin-top: 8px;
    }

    /* Pagination */
    .pagination {
        gap: 5px;
    }

    .page-btn {
        padding: 5px 10px;
        font-size: 12px;
    }

    .page-info {
        padding: 5px 10px;
        font-size: 12px;
    }

    /* Hide pagination text on very small screens */
    .page-btn:not(:disabled)::before {
        content: attr(data-short);
    }

    /* Login */
    .login-container {
        margin: 30px auto;
        padding: 0 15px;
    }

    .login-card {
        padding: 25px 20px;
        border-radius: 15px;
    }

    .login-header h2 {
        font-size: 22px;
    }

    .login-header p {
        font-size: 13px;
    }

    .form-control {
        padding: 10px 12px;
        font-size: 14px;
    }

    .btn-login {
        padding: 12px;
        font-size: 15px;
    }

    /* Notification */
    .notification {
        right: 15px;
        left: 15px;
        top: 70px;
        padding: 10px 15px;
        font-size: 13px;
    }

    /* Lightbox */
    .lightbox img {
        max-width: 98%;
        max-height: 80%;
        border-radius: 8px;
    }

    .lightbox-close {
        top: 15px;
        right: 15px;
        font-size: 25px;
        width: 35px;
        height: 35px;
    }

    /* Upload Section */
    .upload-section {
        padding: 15px;
        margin-bottom: 20px;
    }

    .upload-section h5 {
        font-size: 16px;
    }

    .upload-btn-large {
        padding: 8px 20px;
        font-size: 14px;
    }

    /* Empty State */
    .empty-state {
        padding: 40px 15px;
    }

    .empty-state-icon {
        font-size: 48px;
    }

    .empty-state-text {
        font-size: 16px;
    }

    .empty-state-subtext {
        font-size: 13px;
    }

    /* Member Cards */
    .member-card {
        border-radius: 12px;
    }

    .member-card .card-body {
        padding: 12px !important;
    }

    /* Gallery Item Overlay */
    .gallery-item-overlay {
        padding: 10px;
    }

    .gallery-item-info {
        font-size: 11px;
    }

    .gallery-action-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
}

/* Extra Small Mobile (< 360px) */
@media (max-width: 360px) {
    .header h1 {
        font-size: 16px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .skill-card div[style*="font-size: 48px"] {
        font-size: 32px !important;
    }

    .message-header {
        gap: 8px;
    }

    .pagination {
        flex-direction: column;
        gap: 8px;
    }

    .page-btn,
    .page-info {
        width: 100%;
        text-align: center;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {

    /* Increase tap targets for touch devices */
    .dashboard-btn,
    .page-btn,
    .gallery-action-btn,
    .upload-btn-large,
    .btn-login {
        min-height: 44px;
        min-width: 44px;
    }

    /* Disable hover effects on touch devices */
    .gallery-item:hover {
        transform: none;
    }

    .skill-card:hover {
        transform: none;
    }

    .message-card:hover {
        transform: none;
    }

    .member-card:hover {
        transform: none;
    }

    /* Show overlay by default on touch devices */
    .gallery-item-overlay {
        opacity: 1;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
    }
}

/* Landscape Orientation Adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .header {
        padding: 10px 15px;
    }

    .login-container {
        margin: 20px auto;
    }

    .lightbox img {
        max-height: 75vh;
    }

    .empty-state {
        padding: 30px 15px;
    }
}

/* Print Styles */
@media print {

    .header,
    .dashboard-btn,
    .upload-section,
    .gallery-item-overlay,
    .pagination,
    .notification,
    .lightbox {
        display: none !important;
    }

    body {
        background: white;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}