/* Base Styles */
:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --accent-color: #e74c3c;
    --text-color: #333;
    --light-text: #666;
    --background-color: #f5f7fa;
    --card-background: #fff;
    --border-color: #ddd;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    
    --font-family: 'Roboto', sans-serif;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4 {
    margin-bottom: 1rem;
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.2rem;
}

p {
    margin-bottom: 1rem;
}

/* Header */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-bottom: 2rem;
}

header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.attribution {
    font-style: italic;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: -0.5rem;
}

/* Main Content */
main {
    padding-bottom: 3rem;
}

.intro {
    text-align: center;
    margin-bottom: 2rem;
}

/* Cards */
.card {
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Upload Section */
.upload-container {
    margin: 1.5rem 0;
}

#drop-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

#drop-area.highlight {
    border-color: var(--primary-color);
    background-color: rgba(52, 152, 219, 0.05);
}

#drop-area.file-selected {
    border-color: #4CAF50;
    background-color: rgba(76, 175, 80, 0.05);
}

.file-loading-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 500;
    color: var(--primary-color);
}

.mini-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.upload-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    position: relative;
}

#fileElem {
    display: none;
}

.button {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.button:hover {
    background-color: var(--secondary-color);
}

.drop-text {
    margin-top: 1rem;
    color: var(--light-text);
}

#preview-container {
    width: 100%;
    max-width: 500px;
    margin: 1rem auto;
    text-align: center;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background-color: white;
    position: relative;
    z-index: 10;
}

.preview-notification {
    background-color: #4CAF50;
    color: white;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px 4px 0 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.preview-notification i {
    color: white;
    font-size: 18px;
}

#preview {
    max-width: 100%;
    max-height: 400px;
    display: block;
    margin: 0 auto;
    border-radius: 0;
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.primary-button, .secondary-button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.primary-button {
    background-color: var(--primary-color);
    color: white;
}

.primary-button:hover {
    background-color: var(--secondary-color);
}

.primary-button:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
}

.secondary-button {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.secondary-button:hover {
    background-color: rgba(52, 152, 219, 0.05);
}

/* Loading Spinner */
#loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 1.5rem;
}

.progress-container {
    width: 100%;
    max-width: 400px;
    height: 20px;
    background-color: #f3f3f3;
    border-radius: 10px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--primary-color);
    border-radius: 10px;
    transition: width 0.3s ease;
}

#progress-text {
    text-align: center;
    color: var(--primary-color);
    font-weight: 500;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid var(--primary-color);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Results Section */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.results-image-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

#results-canvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.results-data {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.angles-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.interpretation-container {
    margin-top: 20px;
    padding: 15px;
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.interpretation-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.interpretation-container p {
    margin: 8px 0;
    font-size: 1rem;
    line-height: 1.4;
}

/* Add colors for different interpretation types */
#sna-interpretation {
    color: inherit;
}

#snb-interpretation {
    color: inherit;
}

#anb-interpretation {
    color: inherit;
}

#gogn-sn-interpretation {
    color: inherit;
}

#gogn-sn-interpretation-text {
    color: inherit;
}

#i-to-na-interpretation {
    color: inherit;
}

#i-to-nb-interpretation {
    color: inherit;
}

#interincisal-interpretation {
    color: inherit;
}

.landmarks-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.result-item {
    padding: 1rem;
    background-color: rgba(52, 152, 219, 0.05);
    border-radius: 4px;
}

.angle-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0.5rem 0;
}

.normal-range {
    font-size: 0.9rem;
    color: var(--light-text);
}

.interpretation {
    font-size: 1.2rem;
    font-weight: 500;
    padding: 0.5rem 0;
}

.landmarks ul {
    list-style: none;
    margin-top: 0.5rem;
}

.landmarks li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.landmark-s {
    color: #4CAF50; /* Green */
    font-weight: 500;
}

.landmark-na {
    color: #2196F3; /* Blue */
    font-weight: 500;
}

.landmark-a {
    color: #F44336;
    font-weight: bold;
}

.landmark-b {
    color: #9C27B0;
    font-weight: bold;
}

.landmark-go {
    color: #009688; /* Teal */
    font-weight: bold;
}

.landmark-gn {
    color: #FFC107; /* Amber */
    font-weight: bold;
}

/* Info Section */
.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Desktop Info Grid Layout */
@media (min-width: 768px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.info-item {
    padding: 1rem;
    background-color: rgba(52, 152, 219, 0.05);
    border-radius: 4px;
}

.info-item ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

footer p {
    margin-bottom: 0.5rem;
}

/* Utility Classes */
.hidden {
    display: none !important;
    visibility: hidden !important;
}

/* Fix icon alignment in headings */
h3 i {
    vertical-align: middle;
    margin-right: 0;
}

h3 .icon-text-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

h3 .icon-text-container [data-i18n] {
    margin-left: 0;
    display: inline-block;
}

/* Language Settings */
.language-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
}

#language-switcher {
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
}

/* Authors Container */
.authors-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 30px 0 15px;
}

.author {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.author-img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    box-shadow: var(--box-shadow);
    margin-bottom: 10px;
}

.author-name {
    font-weight: 500;
    color: var(--text-color);
}

.attribution {
    text-align: center;
    font-style: italic;
    margin-top: 5px;
    color: var(--text-color);
}

/* Analysis Type Toggle */
.analysis-type-toggle {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
    gap: 10px;
}

.analysis-btn {
    padding: 0.8rem 1.5rem;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: white;
    color: var(--primary-color);
}

.analysis-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.analysis-btn:hover:not(.active) {
    background-color: rgba(52, 152, 219, 0.05);
}

/* Incisor Landmarks */
.landmark-u1 {
    color: #FF5722; /* Deep Orange */
    font-weight: bold;
}

.landmark-u2 {
    color: #FF9800; /* Orange */
    font-weight: bold;
}

.landmark-u3 {
    color: #FFC107; /* Amber */
    font-weight: bold;
}

.landmark-l1 {
    color: #8BC34A; /* Light Green */
    font-weight: bold;
}

.landmark-l2 {
    color: #4CAF50; /* Green */
    font-weight: bold;
}

.landmark-l3 {
    color: #009688; /* Teal */
    font-weight: bold;
}

/* Add or update the canvas styling */
.canvas-container {
    position: relative;
    width: 100%;
    max-width: 1024px;
    margin: 0 auto;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#results-canvas {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    max-width: 1024px;
    max-height: 1024px;
    display: block;
}

/* Style for the zoom lens when moving landmarks */
.konvajs-content {
    width: 100% !important;
    height: auto !important;
    max-width: 1024px !important;
    margin: 0 auto;
    display: block;
    position: relative;
}

/* Konva stage canvas preserves aspect ratio */
.konvajs-content canvas {
    width: 100% !important;
    height: auto !important;
    max-width: 1024px !important;
    max-height: 1024px !important;
    display: block !important;
}

.konva-container {
    width: 100%;
    height: 100%;
    display: block;
    position: relative;
    background-color: #f8f8f8; /* Light background to see if container is visible */
}

/* Mobile-specific styles for better display on smaller screens */
@media (max-width: 768px) {
    /* Canvas elements */
    .canvas-container {
        width: 100%;
        max-width: 100%;
        border: none;
        overflow: hidden;
        margin: 0 0 20px 0;
        display: block;
    }
    
    #results-canvas {
        width: 100% !important;
        height: auto !important;
        max-width: 100%;
        max-height: 80vh;
    }
    
    .konvajs-content {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        margin: 0 auto;
    }
    
    .konvajs-content canvas {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        max-height: 80vh !important;
    }
    
    /* Mobile controls styling */
    .mobile-controls {
        display: flex;
        justify-content: center;
        width: 100%;
        gap: 10px;
        margin: 15px auto;
        padding: 0;
    }
    
    .mobile-toggle-btn {
        background: #007bff;
        color: white;
        border: none;
        border-radius: 4px;
        padding: 12px 20px;
        font-size: 16px;
        flex: 1;
        max-width: 45%;
        text-align: center;
    }
    
    /* Landmark styling for mobile */
    .landmark-circle {
        transform: scale(1.5);
    }
    
    .landmark-label {
        font-size: 16px;
        font-weight: bold;
        text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
    }
    
    /* Mobile form elements */
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        margin-bottom: 1rem;
        width: 100%;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button-group button {
        width: 100%;
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    /* Mobile results display */
    .results-container {
        flex-direction: column;
    }
    
    .results-image-container {
        width: 100%;
    }
    
    .results-data-container {
        width: 100%;
        margin-left: 0;
        margin-top: 1.5rem;
    }
    
    /* Override info grid layout for mobile */
    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* Desktop-specific styles */
@media (min-width: 768px) {
    /* Info grid layout for desktop */
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Add specific styling for pognb and gogn-sn containers */
#pognb-angle, #gogn-sn-angle {
    font-weight: bold;
    color: var(--primary-color);
}

.result-item[id^="pognb"], .result-item[id^="gogn"] {
    padding-left: 10px;
}

/* Patient Information Styles */
.patient-info {
    margin-bottom: 1.5rem;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

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

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.25);
}

.form-control::placeholder {
    color: #aaa;
}

/* Chevron Diagram Styles */
.chevron-diagram-container {
    margin: 20px 0;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chevron-diagram-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
    text-align: center;
}

#chevron-diagram {
    width: 100%;
    min-height: 350px;
    overflow: auto;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

#chevron-diagram svg {
    max-width: 800px;
    height: auto;
}

#change-image {
    margin-top: 10px;
    padding: 10px 15px;
} 