/* ==========================================================================
   Patents & Tech Section Styles
   ========================================================================== */

:root {
    --patent-accent-cyan: #00f2fe;
    --patent-accent-purple: #9b51e0;
    --patent-accent-gold: #d4af37;
    --patent-glass-bg: rgba(20, 20, 25, 0.6);
    --patent-glass-border: rgba(255, 255, 255, 0.08);
}

.patents-section {
    position: relative;
    overflow: hidden;
    background-color: var(--bg-primary, #0a0a0f);
    padding: 100px 0;
}

.patents-section::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 40%;
    height: 40%;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.08) 0%, transparent 70%);
    z-index: 1;
    pointer-events: none;
}

.patents-section::after {
    content: '';
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 40%;
    height: 40%;
    background: radial-gradient(circle, rgba(155, 81, 224, 0.08) 0%, transparent 70%);
    z-index: 1;
    pointer-events: none;
}

.patents-filter-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    gap: 20px;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.patents-filter-tabs {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--patent-glass-border);
    padding: 6px;
    border-radius: 30px;
}

.filter-tab {
    background: none;
    border: none;
    color: var(--text-secondary, #a0a0b0);
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tab:hover {
    color: var(--text-primary, #ffffff);
}

.filter-tab.active {
    background: linear-gradient(135deg, var(--patent-accent-cyan), var(--patent-accent-purple));
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.2);
}

.patents-search-wrapper {
    position: relative;
    max-width: 320px;
    width: 100%;
}

.patents-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--patent-glass-border);
    border-radius: 30px;
    padding: 10px 20px 10px 45px;
    color: var(--text-primary, #ffffff);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
}

.patents-search-input:focus {
    border-color: var(--patent-accent-cyan);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.patents-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted, #707080);
    pointer-events: none;
    transition: color 0.3s ease;
}

.patents-search-input:focus + .patents-search-icon {
    color: var(--patent-accent-cyan);
}

.patents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    position: relative;
    z-index: 2;
}

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

.patent-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 30px;
    background: var(--patent-glass-bg);
    border: 1px solid var(--patent-glass-border);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    animation: patentCardFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.patent-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 242, 254, 0.25);
    box-shadow: 0 15px 35px rgba(0, 242, 254, 0.05), inset 0 0 15px rgba(255, 255, 255, 0.02);
}

.patent-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.patent-card-num {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--patent-accent-cyan);
    letter-spacing: 0.05em;
}

.patent-card-category {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.patent-card-category.production {
    color: var(--patent-accent-cyan);
    border-color: rgba(0, 242, 254, 0.2);
    background: rgba(0, 242, 254, 0.05);
}

.patent-card-category.option {
    color: var(--patent-accent-purple);
    border-color: rgba(155, 81, 224, 0.2);
    background: rgba(155, 81, 224, 0.05);
}

.patent-card-category.recommendation {
    color: var(--patent-accent-gold);
    border-color: rgba(212, 175, 55, 0.2);
    background: rgba(212, 175, 55, 0.05);
}

.patent-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 15px;
    color: var(--text-primary, #ffffff);
    word-break: keep-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.patent-card p {
    font-size: 0.85rem;
    color: var(--text-secondary, #a0a0b0);
    line-height: 1.6;
    margin-bottom: 25px;
    word-break: keep-all;
    flex-grow: 1;
}

.patent-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 15px;
}

.patent-card-date {
    font-size: 0.75rem;
    color: var(--text-muted, #707080);
}

.patent-card-btn {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--patent-accent-cyan);
    display: flex;
    align-items: center;
    gap: 5px;
    transition: transform 0.2s ease;
}

.patent-card:hover .patent-card-btn {
    transform: translateX(3px);
}

/* ==========================================================================
   Patent Detail Modal
   ========================================================================== */

.patents-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 8, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.patents-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.patents-modal-container {
    background: rgba(15, 15, 20, 0.95);
    border: 1px solid var(--patent-glass-border);
    border-radius: 20px;
    max-width: 760px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 242, 254, 0.05);
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.patents-modal-overlay.active .patents-modal-container {
    transform: translateY(0) scale(1);
}

.patents-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary, #a0a0b0);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.patents-modal-close:hover {
    color: var(--text-primary, #ffffff);
    background: rgba(255, 255, 255, 0.08);
    transform: rotate(90deg);
}

.patents-modal-body {
    padding: 40px;
}

.modal-header-section {
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 25px;
}

.modal-tag-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}

.modal-patent-num {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--patent-accent-cyan);
}

.modal-title-ko {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.4;
    color: var(--text-primary, #ffffff);
    margin-bottom: 8px;
    word-break: keep-all;
}

.modal-title-en {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted, #707080);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.4;
}

.modal-section {
    margin-bottom: 30px;
}

.modal-section h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--patent-accent-cyan);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-section p {
    font-size: 0.9rem;
    color: var(--text-secondary, #a0a0b0);
    line-height: 1.7;
    word-break: keep-all;
}

.modal-formula-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 24px;
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.modal-formula-math {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.3rem;
    color: #ffffff;
    font-style: italic;
    letter-spacing: 0.05em;
    text-align: center;
    word-break: break-all;
}

.modal-formula-desc {
    font-size: 0.8rem;
    color: var(--text-muted, #707080);
    text-align: center;
    line-height: 1.4;
}

.modal-claims-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-left: 20px;
    margin: 0;
}

.modal-claims-list li {
    font-size: 0.88rem;
    color: var(--text-secondary, #a0a0b0);
    line-height: 1.6;
    word-break: keep-all;
    list-style-type: decimal;
}

/* ==========================================================================
   AI Sandbox Simulator Section
   ========================================================================== */

.sandbox-section {
    background-color: rgba(10, 10, 15, 0.95);
    padding: 100px 0;
    position: relative;
}

.sandbox-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 45px;
}

.sandbox-tab-btn {
    background: var(--patent-glass-bg);
    border: 1px solid var(--patent-glass-border);
    border-radius: 12px;
    padding: 18px 24px;
    color: var(--text-secondary, #a0a0b0);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.sandbox-tab-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.sandbox-tab-btn:hover {
    color: var(--text-primary, #ffffff);
    border-color: rgba(0, 242, 254, 0.2);
    transform: translateY(-2px);
}

.sandbox-tab-btn.active {
    background: rgba(0, 242, 254, 0.05);
    border-color: var(--patent-accent-cyan);
    color: var(--patent-accent-cyan);
    box-shadow: 0 5px 25px rgba(0, 242, 254, 0.05);
}

.sandbox-tab-btn.active svg {
    transform: scale(1.1);
}

.sandbox-view {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: var(--patent-glass-bg);
    border: 1px solid var(--patent-glass-border);
    border-radius: 20px;
    padding: 40px;
    backdrop-filter: blur(12px);
}

.sandbox-view.active {
    display: grid;
    animation: fadeIn 0.5s ease;
}

.simulator-controls {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.simulator-controls h3 {
    font-size: 1.3rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
}

.sim-input-group {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sim-input-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary, #a0a0b0);
}

.sim-select, .sim-text-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--patent-glass-border);
    border-radius: 8px;
    padding: 12px 16px;
    color: #ffffff;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
}

.sim-select:focus, .sim-text-input:focus {
    border-color: var(--patent-accent-cyan);
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.15);
}

.sim-select option {
    background: #0f0f15;
    color: #ffffff;
}

.sim-button {
    background: linear-gradient(135deg, var(--patent-accent-cyan), var(--patent-accent-purple));
    border: none;
    border-radius: 8px;
    padding: 14px 28px;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.15);
    margin-top: 10px;
}

.sim-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 242, 254, 0.25);
}

.simulator-results {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Tab 1: Match Score Circular Gauge */
.score-circle-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    margin-bottom: 30px;
}

.score-svg {
    transform: rotate(-90deg);
}

.score-bg-circle {
    fill: none;
    stroke: rgba(255, 255, 255, 0.03);
    stroke-width: 12;
}

.score-fill-circle {
    fill: none;
    stroke: url(#scoreGradient);
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 565.48; /* 2 * PI * r=90 */
    stroke-dashoffset: 565.48;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.score-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-value {
    font-size: 3.5rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
}

.score-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-muted, #707080);
    margin-top: 4px;
}

.sim-bars {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sim-bar-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sim-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary, #a0a0b0);
}

.sim-bar-bg {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 3px;
    overflow: hidden;
}

.sim-bar-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--patent-accent-cyan), var(--patent-accent-purple));
    border-radius: 3px;
    transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Tab 2: 3D Customizer Mock Preview Card */
.preview-card-wrapper {
    width: 100%;
    max-width: 320px;
    perspective: 1000px;
}

.preview-mock-card {
    width: 100%;
    background: linear-gradient(135deg, rgba(25, 25, 35, 0.95) 0%, rgba(15, 15, 20, 0.95) 100%);
    border: 1px solid var(--patent-glass-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    transition: all 0.5s ease;
    transform-style: preserve-3d;
}

.preview-mock-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 20%, rgba(0, 242, 254, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.preview-mock-image-container {
    width: 100%;
    height: 220px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.preview-mock-silhouette {
    width: 120px;
    height: 120px;
    color: rgba(255, 255, 255, 0.35);
    filter: drop-shadow(0 0 10px rgba(0, 242, 254, 0.2));
    transition: all 0.5s ease;
}

.preview-text-overlay {
    position: absolute;
    bottom: 12px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    letter-spacing: 0.05em;
    padding: 0 10px;
}

.preview-card-info {
    margin-top: 20px;
}

.preview-card-tag {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--patent-accent-cyan);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
    margin-bottom: 6px;
}

.preview-card-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #ffffff;
}

.preview-card-material {
    font-size: 0.75rem;
    color: var(--text-muted, #707080);
    margin-top: 4px;
}

/* Tab 3: Dispatch Terminal Console */
.terminal-wrapper {
    width: 100%;
    background: #050508;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.terminal-header {
    background: #0f0f15;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27c93f; }

.terminal-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary, #a0a0b0);
    font-family: monospace;
}

.terminal-body {
    padding: 20px;
    font-family: monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    color: #a0a0b0;
    height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
}

.terminal-line {
    word-break: break-all;
    white-space: pre-wrap;
}

.terminal-line.cmd {
    color: #ffffff;
}

.terminal-line.cmd::before {
    content: '> ';
    color: var(--patent-accent-cyan);
}

.terminal-line.success {
    color: #27c93f;
}

.terminal-line.info {
    color: var(--patent-accent-cyan);
}

.terminal-line.warning {
    color: var(--patent-accent-gold);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .sandbox-view {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 30px;
    }
    
    .sandbox-tabs {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .sandbox-tab-btn {
        padding: 14px 20px;
    }
}

@media (max-width: 768px) {
    .patents-filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .patents-filter-tabs {
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .patents-search-wrapper {
        max-width: 100%;
    }
    
    .patents-modal-body {
        padding: 25px;
    }
}
