/* Reset dan Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@media (max-width: 375px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 1.6rem;
    }
    
    .header .subtitle {
        font-size: 0.85rem;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .verification-status {
        padding: 16px 12px;
        min-height: 180px;
        gap: 12px;
        border-radius: 10px;
    }
    
    .status-icon {
        font-size: 2.5rem;
    }
    
    .status-title {
        font-size: 1.3rem;
    }
    
    .status-message {
        font-size: 0.9rem;
        padding: 0 8px;
        word-break: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .history-item {
        padding: 12px;
        gap: 8px;
    }
    
    .history-item-content {
        gap: 6px;
    }
    
    .history-item-title {
        font-size: 0.9rem;
    }
    
    .history-item-subtitle {
        font-size: 0.8rem;
    }
    
    .history-item-time {
        font-size: 0.75rem;
    }
    
    .scanner-input-container input {
        padding: 10px;
        font-size: 0.85rem;
    }
    
    .btn-primary, .btn-secondary, .btn-danger {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header-logo {
    display: block;
    margin: 0 auto 12px;
    width: 140px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main Content */
.main-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Scanner Section */
.scanner-section {
    margin-bottom: 30px;
}

.scanner-input-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.scanner-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.scanner-actions .btn-primary,
.scanner-actions .btn-secondary {
    width: 100%;
}

.scanner-input-container label {
    font-weight: 600;
    font-size: 1.1rem;
    color: #555;
}

.scanner-input-container input {
    padding: 15px;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.3s ease;
}

.scanner-input-container input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Button Styles */
.btn-primary, .btn-secondary, .btn-danger {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* Two Column Layout */
.two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

@media (max-width: 1024px) {
    .container {
        padding: 16px;
    }
    .header h1 {
        font-size: 2.2rem;
    }
    .header-logo {
        width: 120px;
    }
    .main-content {
        padding: 24px;
    }
    .two-column-layout {
        grid-template-columns: 1fr;
        gap: 24px;
        display: flex;
        flex-direction: column;
    }
    
    /* Di mobile, hasil verifikasi di atas, riwayat di bawah */
    .results-section {
        order: 1;
    }
    
    .history-section {
        order: 2;
    }
    .history-list {
        max-height: 400px;
    }
    .verification-status {
        min-height: 280px;
    }
    .btn-primary, .btn-secondary, .btn-danger {
        padding: 12px 22px;
        font-size: 0.95rem;
    }
}

.footer {
    text-align: center;
    margin-top: 20px;
    color: white;
    opacity: 0.9;
}

.footer p {
    font-size: 0.95rem;
}

/* History Section */
.history-section {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    height: fit-content;
    max-height: 600px;
 display: flex;
    flex-direction: column;
    gap: 20px;
}

.results-header {
    margin-bottom: 30px;
}

/* Preview Container */
.preview-container {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border: 2px solid #e9ecef;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.preview-header h3 {
    color: #495057;
    font-size: 1.2rem;
}

.website-preview {
    height: 400px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #6c757d;
    text-align: center;
}

/* URL Info Preview Styles */
.url-info-preview {
    background: white;
    border-radius: 10px;
    padding: 25px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.preview-header-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.domain-icon {
    font-size: 2.5rem;
    color: #28a745;
}

.url-details {
    flex: 1;
}

.domain-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #28a745;
    margin-bottom: 5px;
}

.url-path {
    font-size: 0.9rem;
    color: #6c757d;
    word-break: break-all;
    font-family: 'Courier New', monospace;
}

.preview-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 20px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #d4edda;
    padding: 15px 25px;
    border-radius: 25px;
    color: #155724;
    font-weight: 600;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #28a745;
    animation: pulse 2s infinite;
}

.status-dot.active {
    background: #28a745;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.url-warning {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff3cd;
    padding: 15px;
    border-radius: 8px;
    color: #856404;
    font-size: 0.9rem;
}

.warning-icon {
    font-size: 1.2rem;
}

.btn-open-external {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-open-external:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.external-icon {
    font-size: 1.2rem;
}

.iframe-container {
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Verification Container */
.verification-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.verification-status {
    text-align: center;
    padding: 40px;
    border-radius: 15px;
    width: 100%;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.5s ease;
}

.verification-status.authentic {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.3);
}

.verification-status.fake {
    background: linear-gradient(135deg, #dc3545, #fd7e14);
    color: white;
    box-shadow: 0 10px 30px rgba(220, 53, 69, 0.3);
}

.verification-status.error {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: #212529;
    box-shadow: 0 10px 30px rgba(255, 193, 7, 0.3);
}

.status-icon {
    font-size: 6rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.status-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.status-message {
    font-size: 1.05rem;
    opacity: 0.9;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
}

/* History Section */
.history-section {
    border-top: 2px solid #e9ecef;
    padding-top: 30px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.history-header h3 {
    color: #495057;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    background: #f8f9fa;
    border-left: 4px solid #dee2e6;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.history-item.authentic {
    border-left-color: #28a745;
    background: #d4edda;
}

.history-item.fake {
    border-left-color: #dc3545;
    background: #f8d7da;
}

.history-item.error {
    border-left-color: #ffc107;
    background: #fff3cd;
}

.history-info {
    flex: 1;
}

.history-url {
    font-weight: 600;
    margin-bottom: 5px;
    word-break: break-all;
}

.history-time {
    font-size: 0.9rem;
    color: #6c757d;
}

.history-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.history-status.authentic {
    background: #28a745;
    color: white;
}

.history-status.fake {
    background: #dc3545;
    color: white;
}

.history-status.error {
    background: #ffc107;
    color: #212529;
}

.history-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.btn-open-tab {
    padding: 6px 12px;
    border: 1px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-open-tab:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-overlay p {
    color: white;
    font-size: 1.2rem;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
    text-align: center;
}

.camera-content {
    max-width: 600px;
}

#cameraStream {
    width: 100%;
    height: auto;
    border-radius: 12px;
    background: #000;
    margin: 12px 0;
}

.camera-status {
    color: #6c757d;
    font-size: 0.95rem;
}

.camera-actions {
    margin-top: 10px;
}

.camera-permission-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

#cameraPermissionModal .modal-content {
    max-width: 400px;
    text-align: center;
}

#cameraPermissionModal p {
    margin: 12px 0;
    line-height: 1.5;
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #dc3545;
}

.modal-content p {
    margin-bottom: 20px;
    line-height: 1.5;
}

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

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 20px;
    }

    .scanner-input-container {
        gap: 12px;
    }

    #manualVerifyBtn {
        width: 100%;
    }
    
    .scanner-actions {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .two-column-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .results-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .verification-status {
        min-height: 250px;
        padding: 30px 20px;
    }
    
    .status-icon {
        font-size: 4rem;
    }
    
    .status-title {
        font-size: 2rem;
    }
    
    .history-list {
        max-height: 300px;
    }
    
    .history-item {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .history-actions {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .history-status {
        align-self: flex-start;
    }
    
    .btn-open-tab {
        font-size: 0.7rem;
        padding: 5px 10px;
    }

    .btn-danger {
        width: 100%;
    }
    
    .website-preview {
        height: 300px;
    }
    
    .url-info-preview {
        padding: 15px;
    }
    
    .preview-header-info {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .domain-name {
        font-size: 1.1rem;
    }
    
    .url-path {
        font-size: 0.8rem;
    }
    
    .btn-open-external {
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .history-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .history-list {
        max-height: 200px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .header .subtitle {
        font-size: 1rem;
    }

    .header-logo {
        width: 100px;
        margin-bottom: 10px;
    }
    
    .main-content {
        padding: 15px;
    }

    .scanner-input-container {
        gap: 10px;
    }

    #manualVerifyBtn {
        width: 100%;
    }
    
    .scanner-actions {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .scanner-input-container input {
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .btn-primary, .btn-secondary, .btn-danger {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .history-actions {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .history-item {
        align-items: stretch;
    }

    .history-status {
        align-self: flex-start;
    }
    
    .btn-open-tab {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
    
    .url-info-preview {
        padding: 10px;
    }
    
    .preview-header-info {
        padding: 15px;
    }
    
    .domain-icon {
        font-size: 2rem;
    }
    
    .domain-name {
        font-size: 1rem;
    }
    
    .status-indicator {
        padding: 10px 15px;
        font-size: 0.8rem;
    }
    
    .btn-open-external {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .verification-status {
        padding: 20px 15px;
        min-height: 200px;
        gap: 15px;
    }
    
    .status-icon {
        font-size: 3rem;
    }
    
    .status-title {
        font-size: 1.5rem;
    }

    .status-message {
        font-size: 0.95rem;
        padding: 0 10px;
        word-break: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .status-indicator {
        padding: 8px 12px;
        font-size: 0.8rem;
        gap: 6px;
    }
    
    .status-dot {
        width: 10px;
        height: 10px;
    }
    
    .url-warning {
        padding: 12px;
        font-size: 0.85rem;
        gap: 8px;
    }
    
    .warning-icon {
        font-size: 1.1rem;
    }
    
    .btn-open-external {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 1280px) and (max-height: 720px), (max-height: 720px) {
    .container {
        padding: 12px;
    }
    .header {
        margin-bottom: 16px;
    }
    .header-logo {
        width: 110px;
        margin-bottom: 8px;
    }
    .header h1 {
        font-size: 2rem;
    }
    .header .subtitle {
        font-size: 0.95rem;
    }
    .main-content {
        padding: 20px;
    }
    .two-column-layout {
        gap: 20px;
    }
    .history-section {
        padding: 20px;
    }
    .history-list {
        max-height: 220px;
    }
    .history-item {
        padding: 12px;
    }
    .verification-status {
        min-height: 220px;
        padding: 24px 18px;
        gap: 15px;
    }
    
    .status-icon {
        font-size: 3.5rem;
    }
    
    .status-title {
        font-size: 1.6rem;
    }
    
    .status-message {
        font-size: 0.95rem;
        word-break: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .status-indicator {
        padding: 10px 15px;
        font-size: 0.85rem;
    }
    
    .btn-primary, .btn-secondary, .btn-danger {
        padding: 10px 18px;
        font-size: 0.95rem;
    }
    .footer {
        margin-top: 12px;
    }
}