/* Public Portfolio Styles - Dark Mode */

/* Screen Reader Only - for Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --accent-color: #10b981;
    --accent-orange: #f59e0b;
    --secondary-color: #6b7280;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --border-color: #334155;
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.6);
    --glow: 0 0 20px rgba(59, 130, 246, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    border-bottom: 2px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
}

.logo {
    font-size: 30px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.nav {
    display: flex;
    gap: 12px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.nav-link:hover {
    background: var(--bg-card-hover);
    color: var(--text-color);
    border-color: var(--border-color);
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--glow);
}

/* Hero Section */
.hero {
    background: transparent;
    color: white;
    padding: 50px 0 30px 0;
    text-align: center;
    position: relative;
}

.hero .container {
    max-width: 50%;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    padding: 40px 40px 35px 40px;
    border-radius: 16px;
    border: 2px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.hero h2 {
    font-size: 36px;
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-color);
}

.hero p {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-muted);
}

/* Main Content */
.main {
    flex: 1;
    padding: 30px 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Search Bar */
.search-bar {
    margin-bottom: 40px;
}

.search-bar form {
    display: flex;
    gap: 12px;
    max-width: 650px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    color: var(--text-color);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    background: var(--bg-card);
}

.search-button {
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.search-button:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.search-button:active {
    transform: translateY(0);
}

.clear-button {
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-hover) 100%);
    color: var(--text-color);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: inline-block;
}

.clear-button:hover {
    background: linear-gradient(135deg, var(--bg-card-hover) 0%, var(--bg-card) 100%);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* Portfolio Card */
.portfolio-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-hover) 100%);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 2px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
}

.portfolio-card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.3), 0 0 30px rgba(59, 130, 246, 0.2);
    border-color: var(--primary-color);
    border-top-color: var(--primary-light);
    background: linear-gradient(135deg, var(--bg-card-hover) 0%, var(--bg-card) 100%);
}

.portfolio-card-image {
    position: relative;
    width: 100%;
    height: 340px;
    overflow: hidden;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
}

.portfolio-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(0.95);
}

.portfolio-card:hover .portfolio-card-image img {
    transform: scale(1.05);
    filter: brightness(1.05);
}

.portfolio-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 600;
}

.portfolio-card-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 8px 18px;
    border-radius: 24px;
    font-size: 12px;
    font-weight: 800;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid rgba(255,255,255,0.2);
}

.portfolio-card-badge.reserved {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
    }
}

.portfolio-card-content {
    padding: 24px;
}

.portfolio-card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--text-color);
    line-height: 1.3;
    height: 47px;
    letter-spacing: -0.3px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

.portfolio-card-grade {
    margin-bottom: 14px;
}

.grade-badge {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, var(--accent-color) 0%, #059669 100%);
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4), 0 0 15px rgba(16, 185, 129, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.portfolio-card-price {
    font-size: 28px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: 10px;
    filter: drop-shadow(0 2px 4px rgba(59, 130, 246, 0.4));
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 100px 20px;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-color);
}

.empty-state h3 {
    font-size: 28px;
    margin-bottom: 16px;
    color: var(--text-color);
    font-weight: 700;
}

.empty-state p {
    font-size: 18px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    border-top: 2px solid var(--border-color);
    padding: 30px 0;
    margin-top: 60px;
    text-align: center;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
}

.footer p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero .container {
        max-width: 90%;
        padding: 40px 30px;
    }
    
    .hero h2 {
        font-size: 28px;
    }
    
    .hero p {
        font-size: 15px;
    }
    
    .search-bar {
        margin-bottom: 30px;
    }
    
    .search-bar form {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px !important;
        max-width: 100% !important;
    }
    
    /* Search input - full width */
    .search-bar form input[type="text"]#search {
        grid-column: 1 / -1;
        min-width: 0 !important;
    }
    
    /* Grade select - full width */
    .search-bar form select[name="grade"] {
        grid-column: 1 / -1;
        min-width: 0 !important;
    }
    
    /* Min and Max price - side by side */
    .search-bar form input[name="min_price"],
    .search-bar form input[name="max_price"] {
        grid-column: span 1;
        min-width: 0 !important;
    }
    
    /* Sort select - full width */
    .search-bar form select[name="sort"] {
        grid-column: 1 / -1;
        min-width: 0 !important;
    }
    
    /* Filter button - full width */
    .search-bar form button[type="submit"] {
        grid-column: 1 / -1;
    }
    
    /* Clear button - full width */
    .search-bar form .clear-button {
        grid-column: 1 / -1;
    }
    
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
    
    .portfolio-card-image {
        height: 280px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .nav {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-link {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    /* Card Detail Page - Mobile */
    main .container > div[style*="grid-template-columns"] {
        display: block !important;
    }
    
    main .container > div[style*="grid-template-columns"] > div:first-child > div[style*="sticky"] {
        position: relative !important;
        top: auto !important;
    }
    
    main .container > div[style*="grid-template-columns"] > div:first-child .card-carousel {
        height: 400px !important;
    }
    
    main .container > div[style*="grid-template-columns"] > div:first-child img {
        height: 400px !important;
    }
    
    main .container > div[style*="grid-template-columns"] > div {
        margin-bottom: 30px;
    }
    
    /* Contact Page - Mobile */
    main .container > div[style*="grid-template-columns: repeat(auto-fit"] {
        grid-template-columns: 1fr !important;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .hero .container {
        max-width: 70%;
    }
}

@media (max-width: 480px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .logo {
        font-size: 24px;
    }
    
    .hero {
        padding: 40px 0 20px 0;
    }
    
    .hero .container {
        max-width: 95%;
        padding: 30px 20px;
    }
    
    .hero h2 {
        font-size: 24px;
    }
    
    .hero p {
        font-size: 14px;
    }
    
    .header-content {
        padding: 16px 0;
    }
    
    .search-input {
        padding: 11px 14px;
        font-size: 13px;
    }
    
    .search-button,
    .clear-button {
        padding: 11px 18px;
        font-size: 12px;
    }
    
    .portfolio-card-title {
        font-size: 16px;
        height: 42px;
    }
    
    .portfolio-card-price {
        font-size: 24px;
    }
    
    /* Card Detail - Extra Small Screens */
    main .container > div[style*="grid-template-columns"] > div:first-child .card-carousel {
        height: 300px !important;
    }
    
    main .container > div[style*="grid-template-columns"] > div:first-child img {
        height: 300px !important;
    }
    
    main h1 {
        font-size: 24px !important;
    }
    
    main .container > div > div[style*="padding: 40px"] {
        padding: 24px !important;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.portfolio-card {
    animation: fadeIn 0.5s ease-out;
}

.portfolio-card:nth-child(1) { animation-delay: 0.05s; }
.portfolio-card:nth-child(2) { animation-delay: 0.1s; }
.portfolio-card:nth-child(3) { animation-delay: 0.15s; }
.portfolio-card:nth-child(4) { animation-delay: 0.2s; }
.portfolio-card:nth-child(5) { animation-delay: 0.25s; }
.portfolio-card:nth-child(6) { animation-delay: 0.3s; }

