/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: #fff;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

img {
    max-width: 100%;
    height: auto;
}

/* Layout */
.site {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.site-sidebar {
    width: 300px;
    background: #f8f8f8;
    padding: 40px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.site-sidebar.sidebar-right {
    right: 0;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.site-branding {
    margin-bottom: 60px;
}

.site-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
}

.site-title a {
    color: #000;
}

.site-description {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

/* Navigation */
.main-navigation {
    margin-bottom: 40px;
}

.main-navigation ul {
    list-style: none;
}

.main-navigation li {
    margin-bottom: 12px;
}

.main-navigation a {
    font-size: 15px;
    color: #333;
    display: block;
    padding: 8px 0;
    position: relative;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
    color: #000;
}

.main-navigation a::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 1px;
    background: #000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.main-navigation a:hover::before,
.main-navigation .current-menu-item > a::before {
    opacity: 1;
}

/* Contact Info */
.sidebar-contact {
    margin-bottom: 40px;
    font-size: 14px;
    color: #666;
}

.sidebar-contact p {
    margin-bottom: 8px;
}

/* Social Links */
.social-links {
    margin-bottom: auto;
}

.social-links a {
    display: inline-block;
    margin-right: 15px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.social-links a:hover {
    color: #000;
}

/* Sidebar Footer */
.sidebar-footer {
    font-size: 12px;
    color: #999;
    margin-top: 40px;
}

/* Main Content */
.site-main {
    flex: 1;
    margin-left: 300px;
    width: calc(100% - 300px);
    min-height: 100vh;
}

.site-main.sidebar-right {
    margin-left: 0;
    margin-right: 300px;
}

.site-main.no-sidebar {
    margin: 0;
    width: 100%;
}

/* Mobile Header (Hidden on Desktop) */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid #eee;
    z-index: 1000;
    height: 60px;
}

.mobile-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 100%;
}

.mobile-menu-toggle {
    background: none;
    border: none;
    width: 30px;
    height: 24px;
    position: relative;
    cursor: pointer;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: #000;
    margin-bottom: 6px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile menu open state */
body.menu-open {
    overflow: hidden;
}

/* Homepage Carousel */
.homepage-carousel {
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.carousel-container {
    height: 100%;
    position: relative;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease;
}

.carousel-slide.active {
    opacity: 1;
}

.slide-image {
    width: 100%;
    height: 100%;
    position: relative;
}

.slide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-content {
    position: absolute;
    bottom: 80px;
    left: 60px;
    color: #fff;
    z-index: 10;
}

.slide-content h2 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.view-project {
    display: inline-block;
    color: #fff;
    font-size: 16px;
    border-bottom: 1px solid #fff;
    padding-bottom: 2px;
    transition: opacity 0.3s ease;
}

.view-project:hover {
    opacity: 0.7;
}

/* Carousel Navigation */
.carousel-navigation {
    position: absolute;
    bottom: 40px;
    right: 60px;
    display: flex;
    gap: 20px;
    z-index: 20;
}

.carousel-prev,
.carousel-next {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.view-all-works {
    position: absolute;
    bottom: 40px;
    left: 60px;
    color: #fff;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #fff;
    padding-bottom: 2px;
    z-index: 20;
}

.view-all-works:hover {
    opacity: 0.7;
}

/* Portfolio Page */
.portfolio-page {
    padding: 80px 60px;
}

.portfolio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 60px;
}

.portfolio-header h1 {
    font-size: 36px;
    font-weight: 700;
}

/* Portfolio Navigation */
.portfolio-navigation {
    position: relative;
}

.portfolio-nav-toggle {
    background: none;
    border: 1px solid #ddd;
    padding: 12px 20px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.portfolio-nav-toggle:hover {
    border-color: #000;
}

.portfolio-nav-toggle svg {
    transition: transform 0.3s ease;
}

.portfolio-nav-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    list-style: none;
    min-width: 200px;
    margin-top: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.portfolio-nav-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.portfolio-nav-dropdown li {
    border-bottom: 1px solid #f0f0f0;
}

.portfolio-nav-dropdown li:last-child {
    border-bottom: none;
}

.portfolio-nav-dropdown a {
    display: block;
    padding: 12px 20px;
    font-size: 14px;
    color: #666;
    transition: all 0.3s ease;
}

.portfolio-nav-dropdown a:hover,
.portfolio-nav-dropdown a.active {
    color: #000;
    background: #f8f8f8;
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 40px;
}

.portfolio-grid.loading {
    opacity: 0.5;
    pointer-events: none;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    background: #f8f8f8;
    transition: all 0.3s ease;
}

.portfolio-item img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.portfolio-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 30px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.portfolio-overlay h3 {
    color: #fff;
    font-size: 20px;
    font-weight: 600;
}

.portfolio-item:hover img {
    transform: scale(1.05);
}

.portfolio-item:hover .portfolio-overlay {
    transform: translateY(0);
}

/* Contact Page Template */
.contact-page {
    padding: 80px 60px;
    max-width: 800px;
}

.contact-form {
    margin-top: 40px;
}

.form-group {
    margin-bottom: 30px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    background: #f8f8f8;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #000;
    background: #fff;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.submit-button {
    background: #000;
    color: #fff;
    border: none;
    padding: 15px 40px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-button:hover {
    background: #333;
}

/* Loading State */
body.loading {
    overflow: hidden;
}

body.loading::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 9999;
}

body.loaded::before {
    display: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .site-sidebar {
        transform: translateX(-100%);
    }
    
    .site-sidebar.sidebar-right {
        transform: translateX(100%);
    }
    
    .site-sidebar.active {
        transform: translateX(0);
    }
    
    .site-main {
        margin: 0;
        width: 100%;
        padding-top: 60px;
    }
    
    .mobile-header {
        display: block;
    }
    
    .portfolio-page {
        padding: 40px 20px;
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .carousel-navigation {
        bottom: 20px;
        right: 20px;
    }
    
    .view-all-works {
        bottom: 20px;
        left: 20px;
    }
    
    .slide-content {
        left: 20px;
        bottom: 100px;
    }
    
    .slide-content h2 {
        font-size: 32px;
    }
    
    .portfolio-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .portfolio-item img {
        height: 250px;
    }
}

@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    
    .portfolio-header h1 {
        font-size: 28px;
    }
    
    .slide-content h2 {
        font-size: 24px;
    }
    
    .carousel-prev,
    .carousel-next {
        width: 40px;
        height: 40px;
    }
    
    .portfolio-page {
        padding: 40px 15px;
    }
    
    .contact-page {
        padding: 40px 15px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.portfolio-item {
    animation: fadeIn 0.6s ease forwards;
}

.portfolio-item:nth-child(1) { animation-delay: 0.1s; }
.portfolio-item:nth-child(2) { animation-delay: 0.2s; }
.portfolio-item:nth-child(3) { animation-delay: 0.3s; }
.portfolio-item:nth-child(4) { animation-delay: 0.4s; }
.portfolio-item:nth-child(5) { animation-delay: 0.5s; }
.portfolio-item:nth-child(6) { animation-delay: 0.6s; }

/* Print Styles */
@media print {
    .site-sidebar,
    .mobile-header,
    .carousel-navigation,
    .portfolio-navigation {
        display: none !important;
    }
    
    .site-main {
        margin: 0 !important;
        width: 100% !important;
    }
}