/* ===== FONT FACE DECLARATIONS ===== */
@font-face {
    font-family: 'Onest';
    src: url('..//webfonts/Onest-Thin.ttf') format('truetype');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
  }
  
  @font-face {
    font-family: 'Onest';
    src: url('../webfonts/Onest-ExtraLight.ttf') format('truetype');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
  }
  
  @font-face {
    font-family: 'Onest';
    src: url('../webfonts/Onest-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
  }
  
  @font-face {
    font-family: 'Onest';
    src: url('../webfonts/Onest-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
  }
  
  @font-face {
    font-family: 'Onest';
    src: url('../webfonts/Onest-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
  }
  
  @font-face {
    font-family: 'Onest';
    src: url('../webfonts/Onest-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
  }
  
  @font-face {
    font-family: 'Onest';
    src: url('../webfonts/Onest-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
  }
  
  @font-face {
    font-family: 'Onest';
    src: url('../webfonts/Onest-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
  }
  
  @font-face {
    font-family: 'Onest';
    src: url('../webfonts/Onest-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
  }

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Onest', sans-serif;
    line-height: 1.6;
    color: #161614;
    background: #161614;
    min-height: 100vh;
}

/* Header styles */
header {
    background: rgb(255, 255, 255);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: #161614;
    text-align: center;
    margin-bottom: 0.5rem;
}

header p {
    text-align: center;
    color: #7B7B7B;
    font-size: 1.1rem;
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.back-btn {
    background: #161614;
    color: #ffffff;
    border: none;
    padding: 18px 32px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.back-btn:hover {
    background: #1f1f1f;
}

/* Main content */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

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

.model-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.model-preview {
    height: 300px;
    background: #f8f9fa;
    position: relative;
}

.model-preview model-viewer {
    width: 100%;
    height: 100%;
}

.model-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.model-info h3 {
    color: #161614;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.model-info p {
    color: #7B7B7B;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.details-btn {
    background: #161614;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
    text-decoration: none;
    display: block;
    text-align: center;
    width: 100%;
}

.details-btn:hover {
    background: #1f1f1f;
}

/* Viewer page styles */
.viewer-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.model-container {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.model-viewer-wrapper {
    height: 500px;
    margin-bottom: 1rem;
    border-radius: 10px;
    overflow: hidden;
}

.model-viewer-wrapper model-viewer {
    width: 100%;
    height: 100%;
}

.model-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    flex-direction: column;
    align-items: center;
}

.control-btn {
    background: #161614;
    color: #ffffff;
    border: none;
    padding: 18px 32px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

.control-btn:hover {
    background: #1f1f1f;
}

/* Model details */
.model-details {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    height: fit-content;
}

.model-info-card h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 0.5rem;
}

.description {
    color: #7f8c8d;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.model-meta {
    margin-bottom: 1.5rem;
}

.meta-item {
    margin-bottom: 0.5rem;
    color: #34495e;
}

.model-tags h3 {
    color: #2c3e50;
    margin-bottom: 0.8rem;
}

.ar-instructions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #ecf0f1;
}

.ar-instructions h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.ar-instructions ol {
    padding-left: 1.5rem;
    color: #7f8c8d;
}

.ar-instructions li {
    margin-bottom: 0.5rem;
}

/* No models message */
.no-models {
    text-align: center;
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.no-models h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.no-models p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: white;
    background: rgba(0, 0, 0, 0.1);
    margin-top: 3rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .viewer-main {
        grid-template-columns: 1fr;
    }
    
    .models-grid {
        grid-template-columns: 1fr;
    }
    
    .model-controls {
        justify-content: center;
    }
    
    header {
        padding: 1rem;
    }
    
    main {
        padding: 0 1rem;
    }
    
    .back-text {
        display: none;
    }
}

/* AR button custom styling */
model-viewer {
    --poster-color: transparent;
}

/* Smartphone Portrait and Landscape */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px){ #fullscreen { display: none; }}