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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    min-height: 100vh;
    color: #333;
}

/* Background */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
}

.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.particle:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    width: 60px;
    height: 60px;
    top: 60%;
    left: 80%;
    animation-delay: 2s;
}

.particle:nth-child(3) {
    width: 100px;
    height: 100px;
    top: 80%;
    left: 20%;
    animation-delay: 4s;
}

.particle:nth-child(4) {
    width: 40px;
    height: 40px;
    top: 40%;
    left: 60%;
    animation-delay: 1s;
}

.particle:nth-child(5) {
    width: 70px;
    height: 70px;
    top: 10%;
    left: 70%;
    animation-delay: 3s;
}

.particle:nth-child(6) {
    width: 50px;
    height: 50px;
    top: 70%;
    left: 40%;
    animation-delay: 5s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

/* Top Action Buttons */
.top-actions {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 1001;
    display: flex;
    gap: 15px;
}

.intro-btn, .create-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 12px 20px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.intro-btn:hover, .create-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.create-btn {
    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
    border: none;
}

.create-btn:hover {
    background: linear-gradient(135deg, #45a049 0%, #27632a 100%);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

/* Introduction Panel */
.project-info {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

.project-info.hidden {
    display: none !important;
}

.project-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.project-header h1 {
    color: #333;
    font-size: 2.5rem;
    font-weight: 700;
}

.close-btn {
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #ff3742;
    transform: scale(1.1);
}

.project-section {
    margin-bottom: 30px;
}

.project-section h2 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.project-section p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.code-block {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    color: #333;
}

.tech-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 15px 0;
}

.tech-category h3 {
    color: #2c3e50;
    font-size: 1.2rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.tech-category ul {
    list-style: none;
    padding: 0;
}

.tech-category li {
    background: #e3f2fd;
    color: #1976d2;
    padding: 8px 12px;
    margin: 5px 0;
    border-radius: 6px;
    font-weight: 500;
}

.deployment-info p {
    background: #f0f8ff;
    padding: 10px 15px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 4px solid #2196f3;
}

.deployment-info a {
    color: #2196f3;
    text-decoration: none;
    font-weight: 500;
}

.deployment-info a:hover {
    text-decoration: underline;
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Glassmorphism Cards */
.glassmorphism-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    padding: 20px;
    margin-bottom: 20px;
}

/* Header */
header h1 {
    color: white;
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    text-align: center;
    font-weight: 300;
}

/* Admin Mode Indicator */
.admin-indicator {
    margin-top: 15px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: white;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    animation: pulse 2s infinite;
}

.admin-indicator i {
    margin-right: 8px;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    }
    50% {
        box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
    }
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: white;
}

.loading-spinner.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 40px;
    color: white;
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.3);
    border-radius: 15px;
    margin: 20px 0;
}

.error-message.hidden {
    display: none;
}

.error-message i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #ff4757;
}

.error-message button {
    background: #ff4757;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.error-message button:hover {
    background: #ff3742;
    transform: translateY(-2px);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.project-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.project-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.project-content {
    padding: 25px;
}

.project-content h3 {
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.project-description {
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

.project-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.category, .difficulty {
    background: #e3f2fd;
    color: #1976d2;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.difficulty {
    background: #f3e5f5;
    color: #7b1fa2;
}

.technologies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
}

.tech-tag {
    background: #e8f5e8;
    color: #2e7d32;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

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

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #2196f3;
    color: white;
}

.btn-primary:hover {
    background: #1976d2;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #424242;
    color: white;
}

.btn-secondary:hover {
    background: #303030;
    transform: translateY(-2px);
}

.btn-edit {
    background: #ffa726;
    color: white;
}

.btn-edit:hover {
    background: #ff9800;
    transform: translateY(-2px);
}

.btn-delete {
    background: #f44336;
    color: white;
}

.btn-delete:hover {
    background: #d32f2f;
    transform: translateY(-2px);
}

.no-projects {
    text-align: center;
    color: white;
    font-size: 1.2rem;
    padding: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    margin: 20px 0;
}

/* Edit Modal */
.edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.modal-header h2 {
    color: #333;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
}

.modal-header .close-btn {
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.modal-header .close-btn:hover {
    background: #ff3742;
    transform: scale(1.1);
}

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

.modal-content .form-group label {
    display: block;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
}

.modal-content .form-group input,
.modal-content .form-group textarea,
.modal-content .form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    color: #333;
    font-size: 16px;
    box-sizing: border-box;
}

.modal-content .form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.form-actions .btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .project-content {
        padding: 20px;
    }
    
    .top-actions {
        top: 20px;
        right: 20px;
        flex-direction: column;
        gap: 10px;
    }

    .intro-btn, .create-btn {
        padding: 10px 15px;
        font-size: 12px;
    }
    
    .project-info {
        padding: 10px;
    }
    
    .project-content {
        padding: 20px;
    }
    
    .tech-stack {
        grid-template-columns: 1fr;
    }
}

/* Chat Widget Styles */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.chat-toggle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.chat-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

.chat-toggle i {
    font-size: 20px;
}

.chat-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 500px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chat-window.hidden {
    display: none;
}

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

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

.chat-message.user {
    align-self: flex-end;
}

.chat-message.assistant {
    align-self: flex-start;
}

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-message.user .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.chat-message.assistant .message-content {
    background: #f0f2f5;
    color: #333;
}

.message-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.message-content li {
    margin: 4px 0;
}

.chat-input-area {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
}

.chat-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input-container input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.chat-input-container input:focus {
    border-color: #667eea;
}

.chat-input-container button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-input-container button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-input-container button:not(:disabled):hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.chat-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 12px;
    margin-top: 10px;
    padding-left: 10px;
}

.chat-typing.hidden {
    display: none;
}

.chat-typing span {
    width: 6px;
    height: 6px;
    background: #667eea;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.chat-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Mobile responsive for chat widget */
@media (max-width: 768px) {
    .chat-window {
        width: 100vw;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile browsers */
        bottom: 0;
        right: 0;
        left: 0;
        top: 0;
        position: fixed;
        border-radius: 0;
        max-height: 100vh;
        max-height: 100dvh;
    }

    .chat-toggle {
        padding: 12px 20px;
        font-size: 14px;
        bottom: 20px;
        right: 20px;
    }

    .chat-header {
        padding: 20px 15px;
        border-radius: 0;
    }

    .chat-messages {
        padding: 15px;
        padding-bottom: 20px;
        max-height: calc(100vh - 200px); /* Reserve space for header and input */
        max-height: calc(100dvh - 200px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }

    .chat-input-area {
        padding: 15px;
        padding-bottom: 20px; /* Extra padding for safe area on iOS */
        padding-bottom: max(20px, env(safe-area-inset-bottom)); /* Account for iOS notch/home bar */
        background: white;
        position: sticky;
        bottom: 0;
        border-top: 1px solid #e0e0e0;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }

    .chat-input-container {
        display: flex;
        gap: 10px;
        align-items: center;
    }

    .chat-input-container input {
        flex: 1;
        padding: 14px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 25px;
        -webkit-appearance: none; /* Remove iOS styling */
    }

    .chat-input-container button {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
    }

    .chat-typing {
        font-size: 11px;
        margin-top: 8px;
    }

    .chat-message {
        max-width: 85%;
    }

    .message-content {
        font-size: 15px;
        padding: 12px 14px;
    }
}
