* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(-45deg, #1a1f3a, #2d3561, #1f4788, #0d2847);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
    color: #1a1b26;
    line-height: 1.6;
    position: relative;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

/* Prevent horizontal scroll on mobile */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(245, 245, 245, 0.92);
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
}

header {
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

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

h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

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

.contact-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
    padding: 5px;
    border-radius: 4px;
}

@media (max-width: 600px) {
    .contact-link {
        font-size: 13px;
        padding: 8px;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
}

.contact-link:hover {
    color: #8b5cf6;
}

.contact-icon {
    font-size: 16px;
}

img.contact-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.services-inline {
    margin-top: 8px;
    position: relative;
    z-index: 5;
}

/* Add scroll indicators on mobile */
/* Mobile services styling - removed scroll indicators since we now use flex-wrap */

/* Remove scroll indicators on mobile since we now use flex-wrap */

.services-label {
    font-size: 14px;
    font-weight: 600;
    color: #8b5cf6;
    margin-left: 20px;
}

.services-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scroll-behavior: smooth;
}

/* Allow wrapping on smaller screens */
@media (max-width: 768px) {
    .services-list {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Scrollbar styles removed since we now use flex-wrap on mobile */

.service-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: #7c3aed;
    cursor: default;
    transition: all 0.2s ease;
    flex-shrink: 0;
    white-space: nowrap;
    position: relative;
    z-index: 10;
}

.service-tag::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
    margin-bottom: 5px;
    max-width: 250px;
    white-space: normal;
    text-align: center;
    line-height: 1.4;
}

.service-tag:hover::after {
    opacity: 1;
}

.service-tag:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary {
    background: #8b5cf6;
    color: white;
}

.btn-primary:hover {
    background: #7c3aed;
}

.btn-secondary {
    background: #e5e7eb;
    color: #1a1b26;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.stats {
    margin-bottom: 30px;
    color: #6b7280;
    font-size: 14px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 600px) {
    .projects-grid {
        gap: 15px;
    }
}

.project-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(224, 224, 224, 0.6);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .project-card {
        /* Better touch feedback on mobile */
        -webkit-tap-highlight-color: rgba(139, 92, 246, 0.1);
        user-select: none;
    }
    
    .project-card:active {
        transform: scale(0.98);
        transition: transform 0.1s;
    }
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.project-card:hover .project-screenshot img {
    transform: scale(1.05);
}

.project-screenshot {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #f0f0f0;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.status-indicator {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    width: 12px;
    height: 12px;
}

.status-light {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

.status-indicator.online .status-light {
    background: #10b981;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
    animation: pulse-green 2s infinite;
}

.status-indicator.offline .status-light {
    background: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
    animation: pulse-red 2s infinite;
}

.status-indicator.checking .status-light {
    background: #f59e0b;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
    animation: pulse-yellow 1s infinite;
}

@keyframes pulse-green {
    0%, 100% {
        box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
    }
    50% {
        box-shadow: 0 0 16px rgba(16, 185, 129, 0.8);
    }
}

@keyframes pulse-red {
    0%, 100% {
        box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 16px rgba(239, 68, 68, 0.8);
    }
}

@keyframes pulse-yellow {
    0%, 100% {
        box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
    }
    50% {
        box-shadow: 0 0 16px rgba(245, 158, 11, 0.8);
    }
}

.preview-content {
    width: 100%;
    height: 100%;
}

.screenshot-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

@media (max-width: 600px) {
    .screenshot-link {
        -webkit-tap-highlight-color: transparent;
    }
    
    .screenshot-link::before {
        font-size: 12px;
        padding: 6px 12px;
    }
}

.screenshot-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
}

.screenshot-link:hover::after {
    background: rgba(0, 0, 0, 0.1);
}

.screenshot-link::before {
    content: '🔗 Visit Website';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
    pointer-events: none;
    white-space: nowrap;
}

.screenshot-link:hover::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.project-screenshot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.5s ease;
}

/* Image optimization styles */
.image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    background: #f0f0f0;
}

.lazy-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: opacity 0.5s ease, filter 0.5s ease;
    filter: blur(20px);
    opacity: 0.8;
}

.lazy-image.loaded {
    filter: blur(0);
    opacity: 1;
}

.image-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 1;
    transition: opacity 0.3s ease;
}

.image-wrapper.image-loaded .image-loader {
    opacity: 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(139, 92, 246, 0.1);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.screenshot-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    color: #6b7280;
    font-size: 14px;
}

.iframe-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    color: #6b7280;
    text-align: center;
    padding: 20px;
}

.fallback-icon {
    margin-bottom: 12px;
    opacity: 0.5;
}

.fallback-text p {
    font-size: 14px;
    margin-bottom: 4px;
    color: #6b7280;
}

.fallback-text small {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 12px;
    display: block;
}

.fallback-link {
    color: #8b5cf6;
    text-decoration: none;
    font-size: 12px;
    padding: 6px 12px;
    border: 1px solid #8b5cf6;
    border-radius: 4px;
    transition: all 0.2s;
}

.fallback-link:hover {
    background: #8b5cf6;
    color: white;
}

.project-info {
    padding: 20px;
}

.project-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1a1b26;
}

.project-domain {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 12px;
}

.project-domain a {
    color: #6b7280;
    text-decoration: none;
    padding: 2px 0;
}

@media (max-width: 600px) {
    .project-domain a {
        display: inline-block;
        padding: 5px 0;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
}

.project-domain a:hover {
    color: #1a1b26;
}

.project-keywords {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 12px;
}

.project-hosting {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 12px;
    font-style: italic;
}

.project-actions {
    display: flex;
    gap: 10px;
}

.action-link {
    font-size: 12px;
    color: #8b5cf6;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

@media (max-width: 600px) {
    .action-link {
        padding: 8px;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }

    .action-link:active {
        background-color: rgba(139, 92, 246, 0.1);
    }
}

.action-link:hover {
    color: #a78bfa;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
    margin-bottom: 20px;
    font-size: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #1a1b26;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #8b5cf6;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
}

@media (max-width: 1200px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .contact-info {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .services-list {
        justify-content: flex-start;
    }
}

@media (max-width: 600px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .service-tag {
        font-size: 11px;
        padding: 3px 6px;
        min-width: fit-content;
    }
    
    h1 {
        font-size: 20px;
    }
    
    .header-content {
        padding: 15px 0;
        flex-direction: column;
        text-align: center;
    }
    
    .user-info {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        align-items: center;
        width: 100%;
    }
    
    .avatar-img {
        width: 60px;
        height: 60px;
    }
    
    .contact-info {
        justify-content: center;
    }
    
    .user-details {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    
    .services-inline {
        width: 100%;
    }
    
    .services-list {
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
        padding: 0;
        max-width: none;
        width: auto;
        overflow: visible;
    }
    
    .project-card {
        border-radius: 8px;
    }
    
    .project-screenshot {
        aspect-ratio: 16 / 10;
    }
    
    .project-info {
        padding: 15px;
    }
    
    .project-name {
        font-size: 16px;
    }
    
    .project-domain {
        font-size: 13px;
    }
    
    .project-keywords {
        font-size: 13px;
    }
    
    .action-link {
        font-size: 11px;
    }
    
    /* Hide floating shapes on mobile for better performance */
    .floating-shapes {
        display: none;
    }
}

/* Floating shapes animation */
.floating-shapes {
    position: fixed;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    top: 0;
    left: 0;
    pointer-events: none;
}

.shape {
    position: absolute;
    background: rgba(29, 71, 136, 0.03);
    border: 1px solid rgba(29, 71, 136, 0.05);
    backdrop-filter: blur(2px);
}

.shape.circle {
    border-radius: 50%;
}

.shape.square {
    border-radius: 10%;
}

.shape-1 {
    width: 100px;
    height: 100px;
    left: 10%;
    top: 20%;
    animation: float-1 20s infinite ease-in-out;
    background: rgba(31, 71, 136, 0.04);
    border-color: rgba(31, 71, 136, 0.08);
}

.shape-2 {
    width: 150px;
    height: 150px;
    right: 10%;
    top: 10%;
    animation: float-2 25s infinite ease-in-out;
    background: rgba(45, 53, 97, 0.04);
    border-color: rgba(45, 53, 97, 0.08);
}

.shape-3 {
    width: 80px;
    height: 80px;
    left: 70%;
    bottom: 20%;
    animation: float-3 30s infinite ease-in-out;
    background: rgba(13, 40, 71, 0.04);
    border-color: rgba(13, 40, 71, 0.08);
}

.shape-4 {
    width: 120px;
    height: 120px;
    left: 20%;
    bottom: 10%;
    animation: float-4 22s infinite ease-in-out;
    background: rgba(26, 31, 58, 0.04);
    border-color: rgba(26, 31, 58, 0.08);
}

.shape-5 {
    width: 110px;
    height: 110px;
    right: 30%;
    top: 50%;
    animation: float-1 28s infinite ease-in-out;
    background: rgba(31, 71, 136, 0.04);
    border-color: rgba(31, 71, 136, 0.08);
}

@keyframes float-1 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }
    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

@keyframes float-2 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(-30px, 30px) rotate(-120deg);
    }
    66% {
        transform: translate(20px, -20px) rotate(-240deg);
    }
}

@keyframes float-3 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(20px, 20px) rotate(180deg);
    }
    66% {
        transform: translate(-30px, -30px) rotate(360deg);
    }
}

@keyframes float-4 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(-20px, -20px) rotate(-180deg);
    }
    66% {
        transform: translate(30px, 30px) rotate(-360deg);
    }
}