/* ===== Graphing Calculator App Styles ===== */
.graphcalc-app {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: calc(100vh - 180px);
    max-height: calc(100vh - 180px);
}

.graphcalc-container {
    display: flex;
    gap: 1.5rem;
    flex: 1;
    min-height: 0;
}

/* Left Panel */
.graphcalc-left-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 320px;
    flex-shrink: 0;
    min-height: 0;
    max-height: 100%;
}

/* Scrollable Equations Container */
.graphcalc-equations-scroll {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    max-height: 300px;
    padding-right: 4px;
}

.graphcalc-equations-scroll::-webkit-scrollbar {
    width: 6px;
}

.graphcalc-equations-scroll::-webkit-scrollbar-track {
    background: rgba(139, 92, 246, 0.1);
    border-radius: 3px;
}

.graphcalc-equations-scroll::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.4);
    border-radius: 3px;
}

.graphcalc-equations-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.6);
}

/* Section Header */
.graphcalc-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-violet);
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.graphcalc-section-header i {
    font-size: 1rem;
}

/* Equation Section */
.graphcalc-equation-section {
    background: rgba(139, 92, 246, 0.08);
    border-radius: 16px;
    padding: 1rem;
    border: 2px solid rgba(139, 92, 246, 0.2);
    position: relative;
}

/* Color indicator on left side */
.graphcalc-equation-section::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--graph-color, #8b5cf6);
}

/* Close button for additional containers */
.graphcalc-close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(239, 68, 68, 0.15);
    border: none;
    border-radius: 6px;
    color: #ef4444;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.graphcalc-close-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    transform: scale(1.1);
}

/* Button Row */
.graphcalc-btn-row {
    display: flex;
    gap: 1.5rem;
}

.graphcalc-btn-row .graphcalc-draw-btn,
.graphcalc-btn-row .graphcalc-clear-btn {
    flex: 1;
}

/* Section Coordinates Display */
.graphcalc-section-coords {
    margin-top: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 6px;
    border-left: 3px solid var(--graph-color, #8b5cf6);
}

.graphcalc-section-coords-text {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.graphcalc-input-group {
    margin-bottom: 0.75rem;
}

.graphcalc-input-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

/* Equation Preview Box */
.graphcalc-equation-preview {
    min-height: 2.5rem;
    padding: 0.6rem 0.65rem;
    background: rgba(139, 92, 246, 0.03);
    border: 2px solid rgba(139, 92, 246, 0.15);
    border-radius: 10px 10px 0 0;
    border-bottom: none;
    font-size: 0.9rem;
    font-family: 'Times New Roman', 'Georgia', serif;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.2px;
    width: 100%;
    overflow-x: auto;
}

.graphcalc-fx-label {
    color: var(--primary-violet);
    font-weight: 500;
    font-size: 0.8rem;
    font-family: 'Consolas', 'Monaco', monospace;
    white-space: nowrap;
}

.graphcalc-preview-content {
    flex: 1;
    overflow-x: auto;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

.graphcalc-equation-preview .preview-placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
    font-style: italic;
    font-size: 0.9rem;
}

.graphcalc-equation-preview + .graphcalc-equation-input {
    border-radius: 0 0 10px 10px;
    border-top: none;
}

.graphcalc-equation-preview sup {
    font-size: 0.7em;
    vertical-align: super;
    line-height: 0;
    position: relative;
    top: -0.4em;
}

.graphcalc-equation-preview sub {
    font-size: 0.7em;
    vertical-align: sub;
    line-height: 0;
    position: relative;
    top: 0.4em;
}

.graphcalc-equation-preview .math-op {
    vertical-align: middle;
}

.graphcalc-equation-preview .math-func {
    font-style: normal;
}

.graphcalc-equation-preview .sqrt-symbol {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.graphcalc-equation-preview .sqrt-symbol::before {
    content: '√';
    font-size: 1.15em;
}

.graphcalc-equation-preview .sqrt-content {
    border-top: 1.5px solid currentColor;
    padding: 0 2px;
    margin-left: 1px;
}

.graphcalc-equation-preview .placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
    font-style: italic;
    font-size: 0.85em;
}

.graphcalc-equation-preview .nrt-notation {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.graphcalc-equation-preview .nrt-index {
    font-size: 0.65em;
    position: relative;
    top: -0.7em;
    margin-right: -0.1em;
}

/* Fraction notation in preview */
.graphcalc-equation-preview .frac-notation {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    vertical-align: middle;
    margin: 0 0.15em;
}

.graphcalc-equation-preview .frac-numerator {
    border-bottom: 1.5px solid currentColor;
    padding: 0.5em 0.2em 0.1em;
    line-height: 1.3;
}

.graphcalc-equation-preview .frac-denominator {
    padding: 0.1em 0.2em 0.3em;
    line-height: 1.3;
}

/* Point notation in preview */
.graphcalc-equation-preview .point-notation {
    color: var(--primary-violet);
    font-weight: 500;
}

.graphcalc-equation-input {
    width: 100%;
    padding: 0.65rem;
    background: rgba(139, 92, 246, 0.1);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Consolas', 'Monaco', monospace;
    transition: var(--transition);
}

.graphcalc-equation-input:focus {
    outline: none;
    border-color: var(--primary-violet);
    background: rgba(139, 92, 246, 0.15);
}

/* Draw Button */
.graphcalc-draw-btn {
    padding: 0.4rem 0.75rem;
    background: var(--gradient-main);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.graphcalc-draw-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-violet);
}

.graphcalc-clear-btn {
    padding: 0.4rem 0.75rem;
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    color: #ef4444;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.graphcalc-clear-btn:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Add New Graph Button */
.graphcalc-add-graph-btn {
    padding: 0.5rem 0.75rem;
    background: rgba(34, 197, 94, 0.15);
    border: 2px dashed rgba(34, 197, 94, 0.4);
    border-radius: 12px;
    color: #22c55e;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.graphcalc-add-graph-btn:hover {
    background: rgba(34, 197, 94, 0.25);
    border-color: rgba(34, 197, 94, 0.6);
    transform: translateY(-2px);
}

/* Keyboard Section */
.graphcalc-keyboard-section {
    background: rgba(139, 92, 246, 0.08);
    border-radius: 16px;
    padding: 1rem;
    border: 2px solid rgba(139, 92, 246, 0.2);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: visible;
}

.graphcalc-keyboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 0.5rem;
}

.graphcalc-key {
    background: rgba(139, 92, 246, 0.15);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
}

.graphcalc-key:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: var(--primary-violet);
    transform: scale(1.05);
}

.graphcalc-key:active {
    transform: scale(0.95);
}

.graphcalc-key sub {
    font-size: 0.7em;
    vertical-align: sub;
}

.graphcalc-key sup {
    font-size: 0.7em;
    vertical-align: super;
}

/* Fraction key icon */
.graphcalc-key .key-frac-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    font-size: 0.7em;
}

.graphcalc-key .frac-num,
.graphcalc-key .frac-den {
    font-size: 0.9em;
}

.graphcalc-key .frac-line {
    width: 1.2em;
    height: 2px;
    background: currentColor;
}

/* Point key icon */
.graphcalc-key .key-point-icon {
    font-size: 0.85em;
    font-weight: 500;
}

/* Trig Toggle Button */
.graphcalc-trig-toggle {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

.graphcalc-trig-toggle:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: #3b82f6;
}

/* Trigonometric Functions Overlay */
.graphcalc-trig-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: 0.5rem;
    width: 200px;
    background: rgba(26, 26, 46, 0.98);
    border-radius: 14px;
    z-index: 100;
    flex-direction: column;
    padding: 0.6rem;
    border: 2px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.graphcalc-trig-overlay.active {
    display: flex;
}

.graphcalc-trig-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.3);
}

.graphcalc-trig-header span {
    color: var(--primary-violet);
    font-weight: 600;
    font-size: 0.75rem;
}

.graphcalc-trig-close {
    background: rgba(239, 68, 68, 0.15);
    border: none;
    border-radius: 5px;
    color: #ef4444;
    width: 22px;
    height: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 0.7rem;
}

.graphcalc-trig-close:hover {
    background: rgba(239, 68, 68, 0.3);
}

.graphcalc-trig-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.3rem;
    flex: 1;
    overflow-y: auto;
}

.graphcalc-trig-btn {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    padding: 0.3rem 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.graphcalc-trig-btn:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: var(--primary-violet);
    transform: scale(1.05);
}

.graphcalc-trig-btn:active {
    transform: scale(0.95);
}

/* Light theme for trig overlay */
.graphcalc-app.light-theme .graphcalc-trig-overlay {
    background: rgba(248, 249, 250, 0.98);
    border-color: #e0e0e0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.graphcalc-app.light-theme .graphcalc-trig-btn {
    background: #ffffff;
    border-color: #e0e0e0;
    color: #1a1a2e;
}

.graphcalc-app.light-theme .graphcalc-trig-btn:hover {
    background: #f0f0f0;
}

/* Right Panel - Graph */
.graphcalc-right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 0;
}

.graphcalc-graph-container {
    flex: 1;
    background: rgba(139, 92, 246, 0.08);
    border-radius: 16px;
    border: 2px solid rgba(139, 92, 246, 0.2);
    overflow: hidden;
    position: relative;
    min-height: 0;
}

.graphcalc-graph-container canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Zoom Controls */
.graphcalc-zoom-controls {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

.graphcalc-zoom-y {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.graphcalc-zoom-row {
    display: flex;
    flex-direction: row;
    gap: 4px;
}

/* Download Button */
.graphcalc-download-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: var(--gradient-main);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
    z-index: 10;
}

.graphcalc-download-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.graphcalc-download-btn:active {
    transform: scale(0.95);
}

.graphcalc-zoom-btn {
    width: 28px;
    height: 28px;
    background: var(--gradient-main);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.graphcalc-zoom-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.graphcalc-zoom-btn:active {
    transform: scale(0.95);
}

.graphcalc-reset-btn {
    font-size: 0.75rem;
}

/* Pan cursor */
.graphcalc-graph-container canvas {
    cursor: grab;
}

/* ===== About Section ===== */
.gc-about-container {
    background: rgba(15, 15, 26, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 8rem;
    padding-top: 1rem;
    border-top: 2px solid rgba(139, 92, 246, 0.2);
}

.gc-info-section h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gc-info-section p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.gc-info-section h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.gc-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.gc-info-card {
    background: var(--bg-card);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    padding: 1.25rem;
    transition: var(--transition);
}

.gc-info-card:hover {
    border-color: var(--primary-violet);
    transform: translateY(-2px);
}

.gc-info-card h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0;
    color: var(--primary-violet);
    font-size: 1rem;
}

.gc-info-card p {
    font-size: 0.9rem;
    margin-bottom: 0;
}

.gc-steps {
    list-style: decimal;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.gc-steps li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.gc-steps code {
    background: rgba(139, 92, 246, 0.2);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
    color: var(--primary-violet);
}

.gc-features {
    background: rgba(139, 92, 246, 0.1);
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1.5rem 0;
}

.gc-features h4 {
    margin-top: 0;
}

.gc-features ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.5rem;
    list-style: none;
    padding: 0;
}

.gc-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.gc-features li i {
    color: #22C55E;
    font-size: 0.85rem;
}

.gc-faq {
    margin-top: 1.5rem;
}

.gc-faq .faq-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

.gc-faq .faq-item:last-child {
    border-bottom: none;
}

.gc-faq .faq-item strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.5rem;
}

.gc-faq .faq-item p {
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* ===== Light Theme ===== */
.gc-about-container.light-theme {
    background: #ffffff;
    border-color: #e0e0e0;
}

.gc-about-container.light-theme h3 {
    color: #1a1a2e;
}

.gc-about-container.light-theme p,
.gc-about-container.light-theme li {
    color: #666;
}

.gc-about-container.light-theme .gc-faq .faq-item strong {
    color: #1a1a2e;
}

.gc-about-container.light-theme .gc-info-card {
    background: #f8f9fa;
    border-color: #e0e0e0;
}

.gc-about-container.light-theme .gc-features {
    background: rgba(139, 92, 246, 0.05);
}

.gc-about-container.light-theme .gc-steps code {
    background: rgba(139, 92, 246, 0.1);
}

.graphcalc-graph-container canvas.grabbing {
    cursor: grabbing;
}

.graphcalc-graph-info {
    position: absolute;
    bottom: 12px;
    left: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.3rem 0.5rem;
    background: rgba(139, 92, 246, 0.9);
    border-radius: 6px;
    border: none;
    z-index: 10;
    height: 28px;
    box-sizing: border-box;
}

.graphcalc-coords {
    color: white;
    font-size: 0.7rem;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* Light Theme */
.graphcalc-app.light-theme .graphcalc-equation-section,
.graphcalc-app.light-theme .graphcalc-keyboard-section,
.graphcalc-app.light-theme .graphcalc-graph-container {
    background: #f8f9fa;
    border-color: #e0e0e0;
}

.graphcalc-app.light-theme .graphcalc-equation-input {
    background: #ffffff;
    border-color: #e0e0e0;
    color: #1a1a2e;
}

.graphcalc-app.light-theme .graphcalc-key {
    background: #ffffff;
    border-color: #e0e0e0;
    color: #1a1a2e;
}

.graphcalc-app.light-theme .graphcalc-key:hover {
    background: #f0f0f0;
    border-color: var(--primary-violet);
}

.graphcalc-app.light-theme .graphcalc-input-group label,
.graphcalc-app.light-theme .graphcalc-coords,
.graphcalc-app.light-theme .graphcalc-section-coords-text {
    color: #666;
}

.graphcalc-app.light-theme .graphcalc-section-coords {
    background: rgba(139, 92, 246, 0.08);
}

/* Responsive */
@media (max-width: 900px) {
    .graphcalc-container {
        flex-direction: column;
    }

    .graphcalc-left-panel {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .graphcalc-equation-section,
    .graphcalc-keyboard-section {
        flex: 1;
        min-width: 280px;
    }

    .graphcalc-graph-container {
        min-height: 350px;
    }
}

@media (max-width: 600px) {
    .graphcalc-left-panel {
        flex-direction: column;
    }

    .graphcalc-equation-section,
    .graphcalc-keyboard-section {
        min-width: 100%;
    }

    .graphcalc-keyboard {
        gap: 0.4rem;
    }

    .graphcalc-key {
        min-height: 45px;
        font-size: 1rem;
    }
}

/* ===== LANDSCAPE RESPONSIVE DESIGN ===== */

/* Large Tablets and Small Laptops in Landscape (1024px - 1200px) */
@media screen and (orientation: landscape) and (max-width: 1200px) {
    .graphcalc-app {
        gap: 0.75rem;
        height: calc(100vh - 150px);
        max-height: calc(100vh - 150px);
    }
    
    .graphcalc-container {
        gap: 1rem;
    }
    
    .graphcalc-left-panel {
        width: 280px;
        gap: 0.6rem;
    }
    
    .graphcalc-equations-scroll {
        max-height: 250px;
    }
    
    .gc-about-container {
        margin-top: 6rem;
        padding: 1.25rem;
    }
    
    .gc-info-section h3 {
        font-size: 1.3rem;
    }
}

/* Tablets in Landscape (768px - 1024px) */
@media screen and (orientation: landscape) and (max-width: 1024px) and (min-width: 768px) {
    .graphcalc-app {
        gap: 0.5rem;
        height: calc(100vh - 120px);
        max-height: calc(100vh - 120px);
    }
    
    .graphcalc-container {
        gap: 0.75rem;
    }
    
    .graphcalc-left-panel {
        width: 240px;
        gap: 0.5rem;
    }
    
    .graphcalc-equations-scroll {
        max-height: 180px;
        gap: 0.5rem;
    }
    
    .graphcalc-section-header {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
        gap: 0.35rem;
    }
    
    .graphcalc-section-header i {
        font-size: 0.85rem;
    }
    
    .graphcalc-equation-section {
        padding: 0.75rem;
        border-radius: 12px;
    }
    
    .graphcalc-equation-section::before {
        width: 3px;
        top: 10px;
        bottom: 10px;
    }
    
    .graphcalc-close-btn {
        width: 20px;
        height: 20px;
        font-size: 0.75rem;
        border-radius: 5px;
    }
    
    .graphcalc-input-group {
        margin-bottom: 0.5rem;
    }
    
    .graphcalc-input-group label {
        font-size: 0.7rem;
        margin-bottom: 0.2rem;
    }
    
    .graphcalc-equation-preview {
        min-height: 2rem;
        padding: 0.45rem 0.5rem;
        font-size: 0.75rem;
        border-radius: 8px 8px 0 0;
    }
    
    .graphcalc-fx-label {
        font-size: 0.65rem;
    }
    
    .graphcalc-equation-input {
        padding: 0.5rem;
        font-size: 0.75rem;
        border-radius: 8px;
    }
    
    .graphcalc-btn-row {
        gap: 0.75rem;
    }
    
    .graphcalc-draw-btn,
    .graphcalc-clear-btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
        border-radius: 8px;
        gap: 0.3rem;
    }
    
    .graphcalc-section-coords {
        margin-top: 0.35rem;
        padding: 0.3rem 0.45rem;
        border-radius: 5px;
    }
    
    .graphcalc-section-coords-text {
        font-size: 0.6rem;
    }
    
    .graphcalc-add-graph-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
        border-radius: 10px;
        gap: 0.35rem;
    }
    
    .graphcalc-keyboard-section {
        padding: 0.75rem;
        border-radius: 12px;
    }
    
    .graphcalc-keyboard {
        gap: 0.35rem;
    }
    
    .graphcalc-key {
        min-height: 35px;
        font-size: 0.85rem;
        border-radius: 8px;
    }
    
    .graphcalc-trig-overlay {
        width: 170px;
        padding: 0.5rem;
        border-radius: 12px;
    }
    
    .graphcalc-trig-header span {
        font-size: 0.65rem;
    }
    
    .graphcalc-trig-close {
        width: 18px;
        height: 18px;
        font-size: 0.6rem;
    }
    
    .graphcalc-trig-grid {
        gap: 0.25rem;
    }
    
    .graphcalc-trig-btn {
        font-size: 0.7rem;
        padding: 0.25rem 0.35rem;
        border-radius: 5px;
    }
    
    .graphcalc-graph-container {
        border-radius: 12px;
    }
    
    .graphcalc-zoom-controls {
        bottom: 10px;
        right: 10px;
        gap: 5px;
    }
    
    .graphcalc-zoom-btn,
    .graphcalc-download-btn {
        width: 24px;
        height: 24px;
        font-size: 0.85rem;
        border-radius: 5px;
    }
    
    .graphcalc-download-btn {
        font-size: 0.7rem;
    }
    
    .graphcalc-graph-info {
        padding: 0.25rem 0.4rem;
        height: 24px;
        border-radius: 5px;
    }
    
    .graphcalc-coords {
        font-size: 0.6rem;
    }
    
    /* About Section */
    .gc-about-container {
        margin-top: 4rem;
        padding: 1rem;
        border-radius: 12px;
    }
    
    .gc-info-section h3 {
        font-size: 1.15rem;
        margin-bottom: 0.75rem;
    }
    
    .gc-info-section p {
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
    }
    
    .gc-info-section h4 {
        font-size: 0.95rem;
        margin-top: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .gc-info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin: 1rem 0;
    }
    
    .gc-info-card {
        padding: 0.875rem;
        border-radius: 10px;
    }
    
    .gc-info-card h4 {
        font-size: 0.85rem;
        gap: 0.35rem;
    }
    
    .gc-info-card p {
        font-size: 0.75rem;
    }
    
    .gc-steps li {
        font-size: 0.8rem;
        margin-bottom: 0.35rem;
    }
    
    .gc-steps code {
        font-size: 0.75em;
        padding: 0.1rem 0.3rem;
    }
    
    .gc-features {
        padding: 1rem;
        border-radius: 10px;
        margin: 1rem 0;
    }
    
    .gc-features ul {
        gap: 0.4rem;
    }
    
    .gc-features li {
        font-size: 0.8rem;
        gap: 0.35rem;
    }
    
    .gc-features li i {
        font-size: 0.7rem;
    }
    
    .gc-faq {
        margin-top: 1rem;
    }
    
    .gc-faq .faq-item {
        margin-bottom: 0.75rem;
        padding-bottom: 0.75rem;
    }
    
    .gc-faq .faq-item strong {
        font-size: 0.85rem;
        margin-bottom: 0.35rem;
    }
    
    .gc-faq .faq-item p {
        font-size: 0.75rem;
    }
}

/* Small Tablets / Large Phones in Landscape (600px - 768px) */
@media screen and (orientation: landscape) and (max-width: 768px) and (min-width: 480px) {
    .graphcalc-app {
        gap: 0.35rem;
        height: calc(100vh - 100px);
        max-height: calc(100vh - 100px);
    }
    
    .graphcalc-container {
        gap: 0.5rem;
    }
    
    .graphcalc-left-panel {
        width: 200px;
        gap: 0.35rem;
    }
    
    .graphcalc-equations-scroll {
        max-height: 140px;
        gap: 0.35rem;
        padding-right: 3px;
    }
    
    .graphcalc-equations-scroll::-webkit-scrollbar {
        width: 4px;
    }
    
    .graphcalc-section-header {
        font-size: 0.65rem;
        margin-bottom: 0.35rem;
        gap: 0.25rem;
    }
    
    .graphcalc-section-header i {
        font-size: 0.7rem;
    }
    
    .graphcalc-equation-section {
        padding: 0.5rem;
        border-radius: 10px;
    }
    
    .graphcalc-equation-section::before {
        width: 2.5px;
        top: 8px;
        bottom: 8px;
    }
    
    .graphcalc-close-btn {
        width: 16px;
        height: 16px;
        font-size: 0.6rem;
        border-radius: 4px;
        top: 5px;
        right: 5px;
    }
    
    .graphcalc-input-group {
        margin-bottom: 0.35rem;
    }
    
    .graphcalc-input-group label {
        font-size: 0.55rem;
        margin-bottom: 0.15rem;
    }
    
    .graphcalc-equation-preview {
        min-height: 1.5rem;
        padding: 0.3rem 0.4rem;
        font-size: 0.65rem;
        border-radius: 6px 6px 0 0;
        gap: 0.3rem;
    }
    
    .graphcalc-fx-label {
        font-size: 0.55rem;
    }
    
    .graphcalc-preview-content {
        font-size: 0.65rem;
    }
    
    .graphcalc-equation-input {
        padding: 0.35rem;
        font-size: 0.6rem;
        border-radius: 6px;
    }
    
    .graphcalc-btn-row {
        gap: 0.5rem;
    }
    
    .graphcalc-draw-btn,
    .graphcalc-clear-btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.6rem;
        border-radius: 6px;
        gap: 0.2rem;
    }
    
    .graphcalc-draw-btn i,
    .graphcalc-clear-btn i {
        font-size: 0.55rem;
    }
    
    .graphcalc-section-coords {
        margin-top: 0.25rem;
        padding: 0.2rem 0.35rem;
        border-radius: 4px;
        border-left-width: 2px;
    }
    
    .graphcalc-section-coords-text {
        font-size: 0.5rem;
    }
    
    .graphcalc-add-graph-btn {
        padding: 0.3rem 0.45rem;
        font-size: 0.6rem;
        border-radius: 8px;
        gap: 0.25rem;
    }
    
    .graphcalc-add-graph-btn i {
        font-size: 0.55rem;
    }
    
    .graphcalc-keyboard-section {
        padding: 0.5rem;
        border-radius: 10px;
    }
    
    .graphcalc-keyboard {
        gap: 0.25rem;
    }
    
    .graphcalc-key {
        min-height: 28px;
        font-size: 0.7rem;
        border-radius: 6px;
    }
    
    .graphcalc-key sub,
    .graphcalc-key sup {
        font-size: 0.6em;
    }
    
    .graphcalc-trig-overlay {
        width: 140px;
        padding: 0.4rem;
        border-radius: 10px;
        margin-left: 0.35rem;
    }
    
    .graphcalc-trig-header {
        margin-bottom: 0.35rem;
        padding-bottom: 0.25rem;
    }
    
    .graphcalc-trig-header span {
        font-size: 0.55rem;
    }
    
    .graphcalc-trig-close {
        width: 15px;
        height: 15px;
        font-size: 0.5rem;
        border-radius: 4px;
    }
    
    .graphcalc-trig-grid {
        gap: 0.2rem;
    }
    
    .graphcalc-trig-btn {
        font-size: 0.55rem;
        padding: 0.2rem 0.25rem;
        border-radius: 4px;
    }
    
    .graphcalc-graph-container {
        border-radius: 10px;
    }
    
    .graphcalc-zoom-controls {
        bottom: 8px;
        right: 8px;
        gap: 4px;
    }
    
    .graphcalc-zoom-y {
        gap: 3px;
    }
    
    .graphcalc-zoom-row {
        gap: 3px;
    }
    
    .graphcalc-zoom-btn,
    .graphcalc-download-btn {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
        border-radius: 4px;
    }
    
    .graphcalc-download-btn {
        top: 8px;
        right: 8px;
        font-size: 0.55rem;
    }
    
    .graphcalc-graph-info {
        bottom: 8px;
        left: 8px;
        padding: 0.2rem 0.3rem;
        height: 20px;
        border-radius: 4px;
    }
    
    .graphcalc-coords {
        font-size: 0.5rem;
    }
    
    /* About Section */
    .gc-about-container {
        margin-top: 2rem;
        padding: 0.75rem;
        border-radius: 10px;
    }
    
    .gc-info-section h3 {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }
    
    .gc-info-section p {
        font-size: 0.65rem;
        margin-bottom: 0.5rem;
        line-height: 1.5;
    }
    
    .gc-info-section h4 {
        font-size: 0.8rem;
        margin-top: 0.75rem;
        margin-bottom: 0.4rem;
    }
    
    .gc-info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        margin: 0.75rem 0;
    }
    
    .gc-info-card {
        padding: 0.6rem;
        border-radius: 8px;
    }
    
    .gc-info-card h4 {
        font-size: 0.7rem;
        gap: 0.25rem;
        margin-bottom: 0.25rem;
    }
    
    .gc-info-card h4 i {
        font-size: 0.65rem;
    }
    
    .gc-info-card p {
        font-size: 0.6rem;
    }
    
    .gc-steps {
        padding-left: 1rem;
    }
    
    .gc-steps li {
        font-size: 0.65rem;
        margin-bottom: 0.25rem;
        line-height: 1.5;
    }
    
    .gc-steps code {
        font-size: 0.7em;
        padding: 0.05rem 0.2rem;
    }
    
    .gc-features {
        padding: 0.65rem;
        border-radius: 8px;
        margin: 0.75rem 0;
    }
    
    .gc-features h4 {
        font-size: 0.75rem;
        margin-bottom: 0.4rem;
    }
    
    .gc-features ul {
        gap: 0.3rem;
    }
    
    .gc-features li {
        font-size: 0.65rem;
        gap: 0.25rem;
    }
    
    .gc-features li i {
        font-size: 0.55rem;
    }
    
    .gc-faq {
        margin-top: 0.75rem;
    }
    
    .gc-faq .faq-item {
        margin-bottom: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    .gc-faq .faq-item strong {
        font-size: 0.7rem;
        margin-bottom: 0.25rem;
    }
    
    .gc-faq .faq-item p {
        font-size: 0.6rem;
    }
}

/* Mobile Phones in Landscape (height < 500px) */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .graphcalc-app {
        gap: 0.25rem;
        height: calc(100vh - 80px);
        max-height: calc(100vh - 80px);
    }
    
    .graphcalc-container {
        gap: 0.4rem;
    }
    
    .graphcalc-left-panel {
        width: 170px;
        gap: 0.25rem;
    }
    
    .graphcalc-equations-scroll {
        max-height: 110px;
        gap: 0.25rem;
        padding-right: 2px;
    }
    
    .graphcalc-equations-scroll::-webkit-scrollbar {
        width: 3px;
    }
    
    .graphcalc-section-header {
        font-size: 0.55rem;
        margin-bottom: 0.25rem;
        gap: 0.2rem;
    }
    
    .graphcalc-section-header i {
        font-size: 0.55rem;
    }
    
    .graphcalc-equation-section {
        padding: 0.35rem;
        border-radius: 8px;
        border-width: 1.5px;
    }
    
    .graphcalc-equation-section::before {
        width: 2px;
        top: 6px;
        bottom: 6px;
    }
    
    .graphcalc-close-btn {
        width: 14px;
        height: 14px;
        font-size: 0.5rem;
        border-radius: 3px;
        top: 4px;
        right: 4px;
    }
    
    .graphcalc-input-group {
        margin-bottom: 0.25rem;
    }
    
    .graphcalc-input-group label {
        font-size: 0.45rem;
        margin-bottom: 0.1rem;
    }
    
    .graphcalc-equation-preview {
        min-height: 1.25rem;
        padding: 0.2rem 0.3rem;
        font-size: 0.55rem;
        border-radius: 5px 5px 0 0;
        gap: 0.2rem;
        border-width: 1.5px;
    }
    
    .graphcalc-fx-label {
        font-size: 0.45rem;
    }
    
    .graphcalc-preview-content {
        font-size: 0.55rem;
    }
    
    .graphcalc-equation-input {
        padding: 0.25rem;
        font-size: 0.5rem;
        border-radius: 5px;
        border-width: 1.5px;
    }
    
    .graphcalc-btn-row {
        gap: 0.35rem;
    }
    
    .graphcalc-draw-btn,
    .graphcalc-clear-btn {
        padding: 0.2rem 0.3rem;
        font-size: 0.5rem;
        border-radius: 5px;
        gap: 0.15rem;
    }
    
    .graphcalc-draw-btn i,
    .graphcalc-clear-btn i {
        font-size: 0.45rem;
    }
    
    .graphcalc-section-coords {
        margin-top: 0.2rem;
        padding: 0.15rem 0.25rem;
        border-radius: 3px;
    }
    
    .graphcalc-section-coords-text {
        font-size: 0.4rem;
    }
    
    .graphcalc-add-graph-btn {
        padding: 0.2rem 0.35rem;
        font-size: 0.5rem;
        border-radius: 6px;
        gap: 0.2rem;
    }
    
    .graphcalc-add-graph-btn i {
        font-size: 0.45rem;
    }
    
    .graphcalc-keyboard-section {
        padding: 0.35rem;
        border-radius: 8px;
        border-width: 1.5px;
    }
    
    .graphcalc-keyboard {
        gap: 0.2rem;
    }
    
    .graphcalc-key {
        min-height: 22px;
        font-size: 0.55rem;
        border-radius: 5px;
        border-width: 1.5px;
    }
    
    .graphcalc-key sub,
    .graphcalc-key sup {
        font-size: 0.5em;
    }
    
    .graphcalc-trig-overlay {
        width: 120px;
        padding: 0.3rem;
        border-radius: 8px;
        margin-left: 0.25rem;
        border-width: 1.5px;
    }
    
    .graphcalc-trig-header {
        margin-bottom: 0.25rem;
        padding-bottom: 0.2rem;
    }
    
    .graphcalc-trig-header span {
        font-size: 0.45rem;
    }
    
    .graphcalc-trig-close {
        width: 13px;
        height: 13px;
        font-size: 0.4rem;
        border-radius: 3px;
    }
    
    .graphcalc-trig-grid {
        gap: 0.15rem;
    }
    
    .graphcalc-trig-btn {
        font-size: 0.45rem;
        padding: 0.15rem 0.2rem;
        border-radius: 3px;
    }
    
    .graphcalc-graph-container {
        border-radius: 8px;
        border-width: 1.5px;
    }
    
    .graphcalc-zoom-controls {
        bottom: 6px;
        right: 6px;
        gap: 3px;
    }
    
    .graphcalc-zoom-y {
        gap: 2px;
    }
    
    .graphcalc-zoom-row {
        gap: 2px;
    }
    
    .graphcalc-zoom-btn,
    .graphcalc-download-btn {
        width: 18px;
        height: 18px;
        font-size: 0.6rem;
        border-radius: 3px;
    }
    
    .graphcalc-download-btn {
        top: 6px;
        right: 6px;
        font-size: 0.5rem;
    }
    
    .graphcalc-graph-info {
        bottom: 6px;
        left: 6px;
        padding: 0.15rem 0.25rem;
        height: 18px;
        border-radius: 3px;
    }
    
    .graphcalc-coords {
        font-size: 0.45rem;
    }
    
    /* About Section */
    .gc-about-container {
        margin-top: 1.5rem;
        padding: 0.6rem;
        border-radius: 8px;
    }
    
    .gc-info-section h3 {
        font-size: 0.8rem;
        margin-bottom: 0.4rem;
    }
    
    .gc-info-section p {
        font-size: 0.55rem;
        margin-bottom: 0.35rem;
        line-height: 1.4;
    }
    
    .gc-info-section h4 {
        font-size: 0.65rem;
        margin-top: 0.5rem;
        margin-bottom: 0.3rem;
    }
    
    .gc-info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.35rem;
        margin: 0.5rem 0;
    }
    
    .gc-info-card {
        padding: 0.45rem;
        border-radius: 6px;
    }
    
    .gc-info-card h4 {
        font-size: 0.55rem;
        gap: 0.2rem;
        margin-bottom: 0.2rem;
    }
    
    .gc-info-card h4 i {
        font-size: 0.5rem;
    }
    
    .gc-info-card p {
        font-size: 0.5rem;
        line-height: 1.3;
    }
    
    .gc-steps {
        padding-left: 0.85rem;
    }
    
    .gc-steps li {
        font-size: 0.55rem;
        margin-bottom: 0.2rem;
        line-height: 1.4;
    }
    
    .gc-steps code {
        font-size: 0.65em;
        padding: 0.05rem 0.15rem;
    }
    
    .gc-features {
        padding: 0.5rem;
        border-radius: 6px;
        margin: 0.5rem 0;
    }
    
    .gc-features h4 {
        font-size: 0.6rem;
        margin-bottom: 0.3rem;
    }
    
    .gc-features ul {
        gap: 0.25rem;
    }
    
    .gc-features li {
        font-size: 0.55rem;
        gap: 0.2rem;
    }
    
    .gc-features li i {
        font-size: 0.45rem;
    }
    
    .gc-faq {
        margin-top: 0.5rem;
    }
    
    .gc-faq .faq-item {
        margin-bottom: 0.4rem;
        padding-bottom: 0.4rem;
    }
    
    .gc-faq .faq-item strong {
        font-size: 0.6rem;
        margin-bottom: 0.2rem;
    }
    
    .gc-faq .faq-item p {
        font-size: 0.5rem;
    }
}

/* Very small mobile landscape (height < 400px) */
@media screen and (orientation: landscape) and (max-height: 400px) {
    .graphcalc-app {
        gap: 0.2rem;
        height: calc(100vh - 65px);
        max-height: calc(100vh - 65px);
    }
    
    .graphcalc-container {
        gap: 0.3rem;
    }
    
    .graphcalc-left-panel {
        width: 145px;
        gap: 0.2rem;
    }
    
    .graphcalc-equations-scroll {
        max-height: 85px;
    }
    
    .graphcalc-equation-section {
        padding: 0.25rem;
    }
    
    .graphcalc-section-header {
        font-size: 0.45rem;
        margin-bottom: 0.2rem;
    }
    
    .graphcalc-equation-preview {
        min-height: 1rem;
        padding: 0.15rem 0.25rem;
        font-size: 0.5rem;
    }
    
    .graphcalc-equation-input {
        padding: 0.2rem;
        font-size: 0.45rem;
    }
    
    .graphcalc-draw-btn,
    .graphcalc-clear-btn {
        padding: 0.15rem 0.25rem;
        font-size: 0.45rem;
    }
    
    .graphcalc-keyboard-section {
        padding: 0.25rem;
    }
    
    .graphcalc-key {
        min-height: 18px;
        font-size: 0.45rem;
    }
    
    .graphcalc-trig-overlay {
        width: 100px;
        padding: 0.2rem;
    }
    
    .graphcalc-trig-btn {
        font-size: 0.4rem;
        padding: 0.1rem 0.15rem;
    }
    
    .graphcalc-zoom-btn,
    .graphcalc-download-btn {
        width: 15px;
        height: 15px;
        font-size: 0.5rem;
    }
    
    .graphcalc-graph-info {
        height: 15px;
    }
    
    .graphcalc-coords {
        font-size: 0.4rem;
    }
    
    .gc-about-container {
        margin-top: 1rem;
        padding: 0.45rem;
    }
    
    .gc-info-section h3 {
        font-size: 0.65rem;
    }
    
    .gc-info-section p {
        font-size: 0.45rem;
    }
    
    .gc-info-card {
        padding: 0.35rem;
    }
    
    .gc-info-card h4 {
        font-size: 0.45rem;
    }
    
    .gc-info-card p {
        font-size: 0.4rem;
    }
}
