/* AR Measurement Tool Specific Styles */

/* Tool Page Common Styles */
.tool-page {
    padding-top: 0;
}

.breadcrumb {
    padding: 20px 0;
    font-size: 14px;
    color: var(--text-gray);
}

.breadcrumb a {
    color: var(--text-gray);
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: var(--primary-purple);
}

.breadcrumb .separator {
    margin: 0 10px;
    color: var(--border-color);
}

.breadcrumb .current {
    color: var(--text-dark);
    font-weight: 600;
}

.tool-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
}

.tool-header-content {
    max-width: 800px;
    margin: 0 auto;
}

.tool-icon-large {
    font-size: 72px;
    margin-bottom: 20px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.tool-header h1 {
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 15px;
}

.tool-subtitle {
    font-size: 20px;
    opacity: 0.95;
    margin-bottom: 25px;
    line-height: 1.6;
}

.tool-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 16px;
}

.meta-separator {
    opacity: 0.5;
}

.tool-content {
    padding: 60px 20px;
    background: var(--bg-light);
}

/* Alert Box */
.alert-box {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-box.info {
    background: #e3f2fd;
    border: 2px solid #2196f3;
    color: #1565c0;
}

.alert-box.warning {
    background: #fff3e0;
    border: 2px solid #ff9800;
    color: #e65100;
}

.alert-box.error {
    background: #ffebee;
    border: 2px solid #f44336;
    color: #c62828;
}

.alert-box.success {
    background: #e8f5e9;
    border: 2px solid #4caf50;
    color: #2e7d32;
}

/* AR Measurement Container */
.ar-measurement-container {
    max-width: 900px;
    margin: 0 auto;
}

/* Instructions Panel */
.ar-instructions {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.ar-instructions h2 {
    font-size: 28px;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

.instruction-steps {
    margin-bottom: 35px;
}

.step {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    transition: all 0.3s;
}

.step:hover {
    background: #e3f2fd;
    transform: translateX(5px);
}

.step-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.step-content strong {
    display: block;
    color: #333;
    font-size: 16px;
    margin-bottom: 5px;
}

.step-content p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.device-requirements {
    background: #fff8e1;
    padding: 25px;
    border-radius: 12px;
    border: 2px solid #ffc107;
    margin-bottom: 30px;
}

.device-requirements h3 {
    color: #f57c00;
    font-size: 18px;
    margin-bottom: 15px;
}

.device-requirements ul {
    margin: 0;
    padding-left: 20px;
    color: #555;
}

.device-requirements li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.ar-start-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.ar-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
}

.ar-start-btn:active {
    transform: translateY(0);
}

/* AR Canvas Container */
.ar-canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
}

#arCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* AR Overlay UI */
.ar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000;
}

.ar-overlay > * {
    pointer-events: auto;
}

/* AR Top Bar */
.ar-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
}

.ar-status {
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.ar-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.ar-btn-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
}

.ar-btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

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

.ar-btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.ar-btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

.ar-btn-secondary:hover {
    background: white;
}

/* Measurement Display */
.measurement-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 30px 50px;
    border-radius: 20px;
    text-align: center;
    border: 3px solid #667eea;
}

.measurement-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
}

.value-number {
    font-size: 56px;
    font-weight: 900;
    color: white;
    line-height: 1;
}

.value-unit {
    font-size: 24px;
    color: #667eea;
    font-weight: 600;
}

.measurement-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    margin-top: 10px;
}

/* AR Controls (Bottom) */
.ar-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
}

/* Point Counter */
.point-counter {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 12px 25px;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

#pointCount {
    color: #667eea;
    font-size: 18px;
}

/* AR Reticle (Center Crosshair) */
.ar-reticle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    pointer-events: none;
}

.reticle-inner {
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    position: relative;
    animation: pulse 2s ease-in-out infinite;
}

.reticle-inner::before,
.reticle-inner::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
}

.reticle-inner::before {
    top: 50%;
    left: -10px;
    width: 20px;
    height: 2px;
    transform: translateY(-50%);
}

.reticle-inner::after {
    top: -10px;
    left: 50%;
    width: 2px;
    height: 20px;
    transform: translateX(-50%);
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1); 
        opacity: 1;
    }
    50% { 
        transform: scale(1.1); 
        opacity: 0.8;
    }
}

/* Basic Measurement Fallback */
.basic-measurement {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    text-align: center;
}

.basic-measurement h3 {
    font-size: 24px;
    color: #333;
    margin-bottom: 15px;
}

.basic-measurement p {
    color: #666;
    margin-bottom: 25px;
}

.basic-measure-controls {
    max-width: 500px;
    margin: 0 auto;
}

.measure-btn {
    width: 100%;
    padding: 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.measure-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

#cameraPreview,
#measureCanvas {
    width: 100%;
    max-width: 500px;
    margin: 20px auto;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.measure-info {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.measure-info p {
    margin: 0;
    color: #555;
    font-size: 14px;
}

/* Measurement History */
.measurement-history {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    margin-top: 30px;
}

.measurement-history h3 {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
}

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

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.history-item:hover {
    background: #e3f2fd;
}

.history-value {
    font-weight: 700;
    color: #667eea;
    font-size: 18px;
}

.history-time {
    color: #999;
    font-size: 13px;
}

.clear-history-btn {
    width: 100%;
    padding: 12px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s;
}

.clear-history-btn:hover {
    background: #d32f2f;
}

/* SEO Content Styles */
.seo-content {
    padding: 80px 20px;
    background: white;
}

.content-article {
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.8;
}

.content-article h2 {
    font-size: 32px;
    font-weight: 800;
    margin-top: 50px;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.content-article h2:first-child {
    margin-top: 0;
}

.content-article h3 {
    font-size: 24px;
    font-weight: 700;
    margin-top: 35px;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.content-article p {
    margin-bottom: 20px;
    color: var(--text-gray);
    font-size: 16px;
}

.content-article ul,
.content-article ol {
    margin-bottom: 25px;
    padding-left: 30px;
    color: var(--text-gray);
}

.content-article li {
    margin-bottom: 12px;
    line-height: 1.8;
}

.content-article strong {
    color: var(--text-dark);
    font-weight: 700;
}

.related-tools {
    max-width: 900px;
    margin: 60px auto 0;
    padding: 40px;
    background: var(--bg-light);
    border-radius: var(--border-radius);
}

.related-tools h3 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 30px;
    text-align: center;
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.related-tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 25px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
    text-align: center;
}

.related-tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-purple);
}

.related-tool-card .tool-icon {
    font-size: 42px;
}

.related-tool-card .tool-name {
    font-weight: 700;
    color: var(--text-dark);
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-header h1 {
        font-size: 32px;
    }
    
    .tool-subtitle {
        font-size: 16px;
    }
    
    .tool-icon-large {
        font-size: 52px;
    }
    
    .tool-meta {
        font-size: 14px;
    }
    
    .ar-instructions {
        padding: 25px;
    }
    
    .ar-instructions h2 {
        font-size: 24px;
    }
    
    .step {
        flex-direction: column;
        gap: 12px;
    }
    
    .device-requirements {
        padding: 20px;
    }
    
    .ar-topbar {
        padding: 12px 15px;
    }
    
    .measurement-display {
        padding: 20px 30px;
    }
    
    .value-number {
        font-size: 42px;
    }
    
    .value-unit {
        font-size: 20px;
    }
    
    .ar-controls {
        flex-wrap: wrap;
        width: 90%;
        gap: 10px;
    }
    
    .ar-btn {
        flex: 1;
        min-width: 80px;
        padding: 12px;
        font-size: 12px;
    }
    
    .content-article h2 {
        font-size: 26px;
    }
    
    .content-article h3 {
        font-size: 20px;
    }
    
    .related-tools-grid {
        grid-template-columns: 1fr;
    }
}

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

.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}