/* Professional Monochrome Portfolio Stylesheet */
:root {
    --primary-bg: #000000;
    --secondary-bg: #111111;
    --card-bg: #1a1a1a;
    --accent-color: #ffffff;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --border-color: #333333;
    --hover-bg: #2a2a2a;
    --success-color: #ffffff;
    --error-color: #ffffff;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    padding-bottom: 60px; /* Space for fixed footer */
}

/* Header & Navigation */
.header {
    background: var(--secondary-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.header-hidden {
    transform: translateY(-100%);
}

.nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 3rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 300;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--text-primary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Main Content */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.page-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    color: var(--text-primary);
    font-weight: 100;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* Grid Layouts */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

/* Image Cards */
.image-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.image-card:hover {
    border-color: var(--text-primary);
    background: var(--hover-bg);
}

.image-card img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.image-card:hover img {
    opacity: 0.9;
}

.image-info {
    padding: 1.5rem;
}

.image-title {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 300;
    letter-spacing: 1px;
}

.image-date {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 300;
}

/* Project Cards */
.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 2rem;
    transition: all 0.3s ease;
}

.project-card:hover {
    border-color: var(--text-primary);
    background: var(--hover-bg);
}

.project-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.project-image {
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

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

.project-image img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 12px;
    overflow: hidden;
}

.modal-image {
    width: 100%;
    height: auto;
    display: block;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--text-primary);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--accent-color);
}

/* Fullscreen */
.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--primary-bg);
    z-index: 3000;
    display: none;
    justify-content: center;
    align-items: center;
}

.fullscreen img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.fullscreen-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 1rem;
}

.control-btn {
    background: var(--card-bg);
    border: none;
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.control-btn:hover {
    background: var(--hover-bg);
    color: var(--accent-color);
}

/* Admin Styles */
.admin-container {
    max-width: 2100px;
    margin: 0 auto;
    padding: 2rem;
}

.login-form {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 12px;
    max-width: 400px;
    margin: 5rem auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
}

.btn {
    background: var(--text-primary);
    color: var(--primary-bg);
    border: 1px solid var(--text-primary);
    padding: 0.75rem 2rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn:hover {
    background: transparent;
    color: var(--text-primary);
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background: #cc0000;
}

.admin-section {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    width: 100%;
    box-sizing: border-box;
}

.file-upload {
    border: 2px dashed var(--border-color);
    padding: 2rem;
    text-align: center;
    border-radius: 8px;
    transition: border-color 0.3s ease;
}

.file-upload:hover {
    border-color: var(--accent-color);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.admin-image {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.admin-image img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.admin-image .delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: #e74c3c;
    border: 2px solid #e74c3c;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
    opacity: 1;
}

.delete-btn:hover {
    background: #e74c3c;
    color: white;
    transform: scale(1.1);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-success {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

.alert-error {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid var(--error-color);
    color: var(--error-color);
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--secondary-bg);
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 0;
    z-index: 999;
    height: 60px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.8rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 300;
    letter-spacing: 1px;
}

.legal-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    line-height: 1.8;
}

.legal-page h1 {
    color: var(--accent-color);
    margin-bottom: 2rem;
    text-align: center;
}

.legal-page h2 {
    color: var(--text-primary);
    margin: 2rem 0 1rem 0;
    font-size: 1.3rem;
}

.legal-page p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.legal-page ul {
    margin: 1rem 0;
    padding-left: 2rem;
    color: var(--text-secondary);
}

.legal-page .back-link {
    display: inline-block;
    margin-top: 2rem;
    padding: 0.75rem 1.5rem;
    background: var(--accent-color);
    color: var(--primary-bg);
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.legal-page .back-link:hover {
    background: #00b8e6;
}

/* Responsive */
@media (max-width: 1024px) {
    .container {
        padding: 1rem;
    }
    
    .images-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .project-card {
        padding: 1.5rem;
    }
    
    .project-images {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.8rem;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0.2rem 0;
    }
    
    .nav {
        padding: 0.2rem 1rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.2rem;
        min-height: auto;
    }
    
    .nav-links {
        justify-content: center;
        gap: 1rem;
    }
    
    .nav a {
        font-size: 0.8rem;
        padding: 0.2rem 0.6rem;
        min-height: auto;
    }
    
    .logo {
        font-size: 2rem;
        letter-spacing: 1px;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .image-card {
        border-radius: 6px;
    }
    
    .image-card img {
        height: 200px;
    }
    
    .project-images {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 0.6rem;
    }
    
    .project-image img {
        height: 80px;
    }
    
    .page-title {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
    
    /* Modal improvements for mobile */
    .modal-content {
        margin: 5% auto;
        width: 95%;
        max-width: none;
    }
    
    .modal-image {
        max-height: 70vh;
    }
    
    /* Fullscreen improvements */
    .fullscreen-controls {
        padding: 1rem;
        gap: 1rem;
    }
    
    .control-btn {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .footer-links {
        gap: 1.5rem;
    }
    
    .footer-text {
        font-size: 0.6rem;
    }
    
    .legal-page {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.8rem;
    }
    
    .header {
        padding: 0.8rem 0;
    }
    
    .nav {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }
    
    .nav-links {
        gap: 1.5rem;
    }
    
    .nav a {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }
    
    .image-card img {
        height: 180px;
    }
    
    .project-card {
        padding: 1rem;
    }
    
    .project-images {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 0.5rem;
    }
    
    .project-image img {
        height: 70px;
    }
    
    .page-title {
        font-size: 1.6rem;
        margin-bottom: 1rem;
    }
    
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
    
    /* Footer mobile optimization */
    .footer {
        padding: 0.8rem 0;
        height: auto;
        min-height: 60px;
    }
    
    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.8rem;
        padding: 0 1rem;
    }
    
    .footer-links {
        gap: 1.5rem;
        justify-content: center;
    }
    
    .footer-links a {
        font-size: 0.8rem;
    }
    
    .footer-text {
        font-size: 0.7rem;
        margin: 0;
        text-align: center;
    }
    
    /* Modal mobile optimization */
    .modal-content {
        margin: 2% auto;
        width: 98%;
        padding: 1rem;
    }
    
    .modal-close {
        font-size: 2rem;
        top: 0.5rem;
        right: 1rem;
    }
    
    /* Fullscreen mobile optimization */
    .fullscreen-controls {
        padding: 0.8rem;
        gap: 0.8rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .control-btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
        min-width: 80px;
    }
    
    .legal-page {
        padding: 0.8rem;
    }
}

/* Project Gallery Modal Styles */
.project-gallery-modal-content {
    max-width: 95vw;
    max-height: 95vh;
    overflow-y: auto;
}

.project-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.2rem;
    padding: 1rem 0;
}

.project-gallery-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.project-gallery-item:hover {
    border-color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

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

.project-gallery-item:hover .project-gallery-image {
    transform: scale(1.05);
}

/* Mobile optimizations for project gallery */
@media (max-width: 768px) {
    .project-gallery-modal-content {
        max-width: 98vw;
        max-height: 98vh;
        margin: 1vh auto;
    }
    
    .project-gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1rem;
    }
    
    .project-gallery-image {
        height: 200px;
    }
    
    #projectGalleryContent {
        padding: 1rem !important;
    }
}

@media (max-width: 480px) {
    .project-gallery-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }
    
    .project-gallery-image {
        height: 150px;
    }
    
    #projectGalleryContent {
        padding: 0.8rem !important;
    }
    
    .project-gallery-modal-content h2 {
        font-size: 1.2rem !important;
        margin-bottom: 1rem !important;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .image-card,
    .project-image img,
    .btn {
        transition: transform 0.2s ease;
    }
    
    .image-card:active,
    .project-image img:active {
        transform: scale(0.98);
    }
    
    .btn:active {
        transform: scale(0.96);
    }
    
    /* Larger touch targets */
    .nav a {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Gallery Controls */
.gallery-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-container {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.search-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: none;
}

.search-clear:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.search-input:not(:placeholder-shown) + .search-clear {
    display: block;
}

.filter-container {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.filter-select {
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.view-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-toggle:hover {
    background: var(--hover-bg);
    border-color: var(--accent-color);
}

.results-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* Gallery View Modes */
.gallery-grid.compact {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.gallery-grid.compact .image-card img {
    height: 200px;
}

.gallery-grid.list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gallery-grid.list .image-card {
    display: flex;
    align-items: center;
    padding: 1rem;
}

.gallery-grid.list .image-card img {
    width: 120px;
    height: 80px;
    margin-right: 1rem;
    flex-shrink: 0;
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Image Fade Animation */
.image-card.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

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

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: var(--text-primary);
}

.breadcrumb-separator {
    color: var(--border-color);
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}

/* Touch Gestures for Mobile */
.swipe-hint {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    z-index: 1000;
    animation: fadeInOut 3s ease-in-out;
    pointer-events: none;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    20%, 80% { opacity: 1; }
}
