/* Variabel Dasar */

:root {
    --primary-color: #573727;
    --primary-light: #8b5e3c;
    --primary-dark: #422b1d;
    --accent-color: #E5E5CB;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --text-dark: #333333;
    --text-light: #666666;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s ease;
}

/* Base Layout */
.detection-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    padding: 1rem 0;
    overflow-x: hidden;
}

/* Titik Navigasi  */
.slide-navigation {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 30px;
    backdrop-filter: blur(5px);
}

.nav-dot {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.nav-dot.active {
    background: var(--primary-color);
    transform: scale(1.2);
}

.nav-dot:hover::before {
    content: attr(title);
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    white-space: nowrap;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Slide System */
.slide-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

.slide {
    display: none;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.5s ease;
    padding: 0 2rem;
}

.slide.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

/* Tutorial Slide */
.tutorial-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.tutorial-content h2 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.tutorial-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.step-card {
    background: var(--gray-100);
    padding: 1rem;
    border-radius: var(--radius-md);
    position: relative;
    transition: var(--transition);
    border-left: 4px solid var(--primary-color);
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.step-number {
    position: absolute;
    top: -15px;
    left: -15px;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: var(--shadow-sm);
}

.step-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.step-card p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Navigation Buttons */
.navigation-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.prev-slide-btn,
.next-slide-btn,
.save-btn,
.new-detection-btn,
.rekomendasi-btn,
.riwayat-btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: var(--primary-color);
    color: var(--white);
}

.prev-slide-btn {
    background: var(--gray-200);
    color: var(--text-dark);
}

.navigation-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.navigation-buttons button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Opsi tombol registrasi */
.selection-options {
    display: flex;
    gap: 2rem;
    margin: 3rem 0;
    justify-content: center;
}

.option-button {
    flex: 1;
    max-width: 400px;
    padding: 1.2rem;
    border: none;
    border-radius: var(--radius-lg);
    background: var(--white);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
    box-shadow: var(--shadow-sm);
}

.option-button:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.option-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
}

.option-text h3 {
    color: var(--primary-color);
    margin-bottom: 0.2rem;
}

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

/* Cat Selection Form */
.select-container {
    max-width: 500px;
    margin: 1rem auto;
    background: var(--white);
    padding: 1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.cat-select {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    color: var(--text-dark);
    background: var(--white);
    transition: var(--transition);
    cursor: pointer;
}

.cat-select:focus {
    border-color: var(--primary-color);
    outline: none;
}

.selected-cat-preview {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--gray-100);
    border-radius: var(--radius-md);
}

.selected-cat-preview .cat-profile {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.selected-cat-preview img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    border: 3px solid var(--white);
    box-shadow: var(--shadow-sm);
}

.selected-cat-preview .cat-info {
    flex: 1;
}

.selected-cat-preview h4 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
}

.selected-cat-preview p {
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

/* Registration Form */
.registration-form {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.form-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

.photo-upload {
    width: 100%;
}

.upload-preview {
    aspect-ratio: 1;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    border: 3px dashed var(--gray-300);
    transition: var(--transition);
}

.upload-preview:hover {
    border-color: var(--primary-color);
}

.upload-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--text-light);
}

.upload-placeholder i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.form-fields {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    color: var(--text-dark);
    font-weight: 500;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
}

.input-wrapper input,
.input-wrapper select {
    width: 100%;
    padding: 0.6rem 0.6rem 0.6rem 2rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 1rem;
    color: var(--text-dark);
    background: var(--white);
    transition: var(--transition);
}

.input-wrapper input:focus,
.input-wrapper select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(87, 55, 39, 0.1);
}

.submit-button {
    width: 100%;
    padding: 0.8rem;
    border: none;
    border-radius: var(--radius-md);
    background: var(--primary-color);
    color: var(--white);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 1rem;
}

.submit-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Detection Content Styling */
.detection-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow-lg);
}

.section-header {
    text-align: center;
    margin-bottom: 0.2rem;
}

.header-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.1rem;
    color: var(--white);
    font-size: 1.5rem;
    box-shadow: var(--shadow-md);
}

.section-header h2 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 0.1rem;
}

.header-subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Selected Cat Panel */
.selected-cat-panel {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 3rem;
    color: var(--white);
}

.cat-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-image {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid var(--white);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.info-tags {
    display: flex;
    gap: 1rem;
}

.tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

/* Capture Options */
.capture-options {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    margin: 3rem 0;
}

.option-btn {
    background: var(--white);
    border: none;
    padding: 1.5rem 2rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.option-btn:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.btn-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
}

.btn-text {
    text-align: left;
}

.btn-text span {
    display: block;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.3rem;
}

.btn-text small {
    color: var(--text-light);
}

/* Preview Container */
.preview-container {
    max-width: 400px;
    margin: 3rem auto;
}

.preview-frame {
    aspect-ratio: 4/3;
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-md);
    border: 3px dashed var(--gray-300);
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
}

.preview-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--text-light);
    text-align: center;
    padding: 1rem;
}

.preview-placeholder i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

/* Results Section */
.results-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    grid-template-rows: auto auto;
    gap: 1.5rem;
    /* kecilin dari 3rem ke 1.5rem biar lebih rapat */
    align-items: stretch;
}

.detection-image-panel {
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    /* isi penuh tinggi seperti card lain */
}


.image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    background-color: #eee;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.results-details {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.result-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.card-header i {
    font-size: 1.1rem;
    color: var(--primary-color);
}

.card-header h3 {
    color: var(--text-dark);
    font-size: 1.1rem;
}

/* Diagnosis Results */
.diagnosis {
    flex-grow: 1;

}

.diagnosis-name {
    font-size: 1.8rem;
    color: var(--primary-color);
    font-weight: 200;
    margin-bottom: 1rem;
}

.diagnosis-category {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.8rem;
}

.probability-container {
    background: var(--gray-100);
    padding: 1.5rem;
    border-radius: var(--radius-md);
}

.probability-container label {
    display: block;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.probability-bar {
    height: 24px;
    background: var(--gray-300);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.probability-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transition: width 1s ease-in-out;
    position: relative;
}

.probability-text {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--white);
    font-weight: 500;
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}




/* Camera Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 800px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 1.5rem;
    background: var(--primary-color);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.3rem;
}

.close-modal-btn {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal-btn:hover {
    transform: rotate(90deg);
}

/* Camera Container */
.camera-container {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
    overflow: hidden;
}

#camera-stream {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.focus-area {
    width: 80%;
    height: 80%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-md);
}

.camera-controls {
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.control-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color);
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.control-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    text-align: center;
    color: var(--white);
}

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

.detection-intro {
    background: linear-gradient(135deg, rgba(87, 55, 39, 0.05), rgba(229, 229, 203, 0.1));
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin: 0.1rem 0;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    border-left: 4px solid var(--primary-color);
}

.intro-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.intro-content {
    flex: 1;
}

.intro-content h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

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

.intro-tips {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.tip-item i {
    color: var(--primary-color);
}

.tip-item span {
    color: var(--text-dark);
    font-size: 0.9rem;
}

/* foto uplaod */
.upload-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.upload-placeholder:hover {
    background: rgba(87, 55, 39, 0.05);
}

.upload-placeholder i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.upload-placeholder span {
    color: var(--text-dark);
    font-weight: 500;
}

.upload-placeholder small {
    color: var(--text-light);
    font-size: 0.9rem;
}



@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .results-grid {
        grid-template-columns: 1fr;
    }

    .detection-image-panel {
        max-height: 500px;
    }
}

@media (max-width: 992px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .photo-upload {
        max-width: 400px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .selection-options {
        flex-direction: column;
    }

    .option-button {
        max-width: 100%;
    }

    .capture-options {
        flex-direction: column;
        gap: 1.5rem;
    }

    .option-btn {
        width: 100%;
    }

    .navigation-buttons {
        flex-direction: column;
    }

    .navigation-buttons button {
        width: 100%;
    }

    .slide {
        padding: 0 1rem;
    }

    .tutorial-steps {
        grid-template-columns: 1fr;
    }

    .detection-intro {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }

    .intro-tips {
        flex-direction: column;
        gap: 1rem;
    }

    .tip-item {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .section-header h2 {
        font-size: 2rem;
    }

    .cat-profile {
        flex-direction: column;
        text-align: center;
    }

    .info-tags {
        justify-content: center;
    }

    .modal-content {
        width: 95%;
    }

    .slide-navigation {
        right: 10px;
    }
}

/* Animasi */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(-100px);
    }
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    background: var(--white);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 2000;
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left: 4px solid #28a745;
}

.notification.error {
    border-left: 4px solid #dc3545;
}

.notification.warning {
    border-left: 4px solid #ffc107;
}
