/* Scientific Calculator Styles - Matching Site Design */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 2.5rem;
    --space-3xl: 3rem;
    --space-4xl: 4rem;
    --space-5xl: 5rem;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    --text-primary-color: #ffffff;
    --text-secondary-color: rgba(255, 255, 255, 0.8);
    --background-color: #000000;
    --primary-color: #4ade80;
    --accent-color: #22c55e;
    
    /* Typography Scale */
    --font-xs: 0.75rem;
    --font-sm: 0.875rem;
    --font-base: 1rem;
    --font-lg: 1.125rem;
    --font-xl: 1.25rem;
    --font-2xl: 1.5rem;
    --font-3xl: 1.875rem;
    --font-4xl: 2.25rem;
    --font-5xl: 3rem;
    
    /* Font Weights */
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;
}

/* Background */
body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('../images/desktop Bg image.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    color: white;
    overflow-x: hidden;
}

/* Mobile background */
@media (max-width: 768px) {
    body {
        background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('../images/mobile Bg image.webp');
        background-size: cover;
        background-position: center;
        background-attachment: fixed;
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    transition: all 0.3s ease;
}

/* Back Button */
.back-button {
    position: absolute;
    top: 30px;
    left: 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.back-button i {
    font-size: 16px;
}

/* Header */
.page-header {
    text-align: center;
    padding: 80px 0 60px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 0.9rem;
    opacity: 0.8;
}

.breadcrumb a {
    color: #4ade80;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.breadcrumb a:hover {
    opacity: 0.8;
}

.breadcrumb span {
    color: rgba(255, 255, 255, 0.6);
}

.page-header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ffffff, #4ade80);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto 30px;
    line-height: 1.6;
}

/* Tool Navigation */
.tool-nav {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 30px 0 0;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.nav-btn:hover,
.nav-btn.active {
    background: rgba(74, 222, 128, 0.2);
    border-color: #4ade80;
    transform: translateY(-2px);
}

.nav-btn i {
    font-size: 16px;
}

/* Calculator Layout */
.tool-section {
    padding: 60px 0;
}

.calculator-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    max-width: 600px;
    margin: 0 auto;
}

/* Calculator Card */
.calculator-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 30px;
    transition: all 0.3s ease;
}

/* Calculator Display */
.calculator-display {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    position: relative;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.display-secondary {
    font-size: 14px;
    opacity: 0.7;
    margin-bottom: 8px;
    min-height: 20px;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.display-main {
    font-size: 2.5rem;
    font-weight: 600;
    text-align: right;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.display-memory {
    position: absolute;
    top: 8px;
    left: 16px;
    font-size: 12px;
    color: #a855f7;
    font-weight: 600;
}

/* Calculator Buttons */
.calculator-buttons {
    display: grid;
    gap: 8px;
}

#basic-buttons {
    grid-template-columns: repeat(4, 1fr);
}

#scientific-buttons {
    grid-template-columns: repeat(4, 1fr);
}

#programmer-buttons {
    grid-template-columns: repeat(4, 1fr);
}

.btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 16px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    font-family: inherit;
    touch-action: manipulation;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn:active {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(0);
}

/* Button Types */
.btn-number {
    background: rgba(255, 255, 255, 0.1);
    font-size: 18px;
    font-weight: 600;
}

.btn-operation {
    background: rgba(74, 222, 128, 0.2);
    border-color: rgba(74, 222, 128, 0.3);
    color: #4ade80;
    font-weight: 600;
}

.btn-equals {
    background: rgba(74, 222, 128, 0.3);
    border-color: rgba(74, 222, 128, 0.4);
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
}

.btn-clear {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
    font-weight: 600;
}

.btn-memory {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.3);
    color: #a855f7;
    font-weight: 600;
    font-size: 14px;
}

.btn-function {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    font-weight: 600;
    font-size: 14px;
}

.btn-base {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    font-weight: 600;
    font-size: 14px;
}

.btn-base.active {
    background: rgba(59, 130, 246, 0.4);
    color: #ffffff;
}

.btn-hex {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    font-weight: 600;
}

.btn-hex:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Calculator Sidebar */
.calculator-sidebar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 30px;
}

.tool-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
}

.tool-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.tool-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 6px;
    color: #ffffff;
}

.tool-description {
    font-size: 0.85rem;
    opacity: 0.8;
    margin: 0 0 16px;
    line-height: 1.4;
}

/* Memory and History Lists */
.memory-list,
.history-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.memory-item,
.history-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.memory-item:hover,
.history-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.memory-value,
.history-expression {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #ffffff;
}

.history-result {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #4ade80;
    font-weight: 600;
}

.memory-controls,
.history-controls {
    display: flex;
    justify-content: center;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    color: #ffffff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Constants Panel */
.constants-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.constant-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.constant-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.constant-name {
    font-weight: 600;
    color: #ffffff;
    font-size: 13px;
}

.constant-value {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #4ade80;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 30px 15px;
    opacity: 0.6;
}

.empty-state i {
    font-size: 1.5rem;
    margin-bottom: 8px;
    display: block;
    color: #64748b;
}

.empty-state p {
    margin: 0;
    font-size: 12px;
    color: #94a3b8;
}

/* Features Section */
.features-section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 16px;
    background: linear-gradient(135deg, #4ade80, #22c55e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-description {
    font-size: 1.1rem;
    opacity: 0.8;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--calculator-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--calculator-border);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 
        0 20px 40px var(--shadow-dark),
        inset 0 1px 0 var(--shadow-light);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 30px 60px var(--shadow-dark),
        inset 0 1px 0 var(--shadow-light);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 12px;
    color: #ffffff;
}

.feature-card p {
    opacity: 0.8;
    line-height: 1.6;
    margin: 0;
}

/* FAQ Section */
.faq {
    padding: 80px 0;
    background: rgba(0, 0, 0, 0.1);
}

.faq-header {
    text-align: center;
    margin-bottom: 60px;
}

.faq-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 16px;
    background: linear-gradient(135deg, #4ade80, #22c55e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.faq-header p {
    font-size: 1.1rem;
    opacity: 0.8;
    margin: 0;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--calculator-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--calculator-border);
    border-radius: 16px;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px var(--shadow-dark);
}

.faq-question {
    padding: 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: rgba(255, 255, 255, 0.05);
}

.faq-question h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

.faq-toggle {
    font-size: 1.5rem;
    font-weight: 300;
    color: #4ade80;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-toggle {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 24px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item.active .faq-answer {
    padding: 0 24px 24px;
    max-height: 200px;
}

.faq-answer p {
    margin: 0;
    opacity: 0.8;
    line-height: 1.6;
}

/* Scrollbar */
.memory-list::-webkit-scrollbar,
.history-list::-webkit-scrollbar {
    width: 6px;
}

.memory-list::-webkit-scrollbar-track,
.history-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.memory-list::-webkit-scrollbar-thumb,
.history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.memory-list::-webkit-scrollbar-thumb:hover,
.history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Responsive Design */
@media (min-width: 768px) {
    .calculator-layout {
        grid-template-columns: 1fr 300px;
        gap: 30px;
        max-width: 1000px;
    }
    
    .calculator-sidebar {
        grid-template-columns: 1fr;
        margin-top: 0;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .page-header {
        padding: 60px 0 40px;
    }
    
    .page-header h1 {
        font-size: 2.5rem;
    }
    
    .page-header p {
        font-size: 1rem;
        margin: 0 auto 20px;
    }
    
    .tool-nav {
        gap: 8px;
        margin: 20px 0 0;
    }
    
    .nav-btn {
        padding: 10px 16px;
        font-size: 14px;
        flex: 1;
        min-width: 80px;
    }
    
    .calculator-card {
        padding: 20px;
    }
    
    .display-main {
        font-size: 2rem;
    }
    
    .calculator-buttons {
        gap: 6px;
    }
    
    .btn {
        padding: 12px;
        font-size: 14px;
        min-height: 44px;
    }
    
    .btn-number {
        font-size: 16px;
    }
    
    .btn-equals {
        font-size: 18px;
    }
    
    .calculator-sidebar {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        margin-top: 20px;
    }
    
    .tool-card {
        padding: 16px;
    }
    
    .tool-icon {
        font-size: 1.25rem;
    }
    
    .tool-name {
        font-size: 1rem;
    }
    
    .tool-description {
        font-size: 0.8rem;
        margin-bottom: 12px;
    }
    
    .memory-list,
    .history-list {
        max-height: 150px;
    }
    
    .back-button {
        top: 20px;
        left: 20px;
        padding: 10px 16px;
        font-size: 14px;
    }
}
    
@media (max-width: 480px) {
    .page-header h1 {
        font-size: 2rem;
    }
    
    .tool-nav {
        flex-direction: column;
        gap: 6px;
    }
    
    .nav-btn {
        padding: 12px;
        justify-content: center;
    }
    
    .calculator-card {
        padding: 16px;
    }
    
    .calculator-buttons {
        gap: 4px;
    }
    
    .btn {
        padding: 10px;
        font-size: 13px;
        min-height: 40px;
    }
    
    .btn-number {
        font-size: 14px;
    }
    
    .btn-equals {
        font-size: 16px;
    }
    
    .display-main {
        font-size: 1.8rem;
    }
    
    .calculator-sidebar {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .back-button {
        top: 16px;
        left: 16px;
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    .calculator-buttons {
        gap: 3px;
    }
    
    .btn {
        padding: 8px;
        font-size: 12px;
        min-height: 36px;
    }
    
    .btn-number {
        font-size: 13px;
    }
    
    .btn-equals {
        font-size: 14px;
    }
    
    .display-main {
        font-size: 1.6rem;
    }
}

/* Landscape Mode for Mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .page-header {
        padding: 40px 0 20px;
    }
    
    .page-header h1 {
        font-size: 2rem;
        margin-bottom: 10px;
    }
    
    .page-header p {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
    
    .tool-section {
        padding: 20px 0;
    }
    
    .calculator-layout {
        gap: 20px;
    }
    
    .calculator-sidebar {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        margin-top: 15px;
    }
}

/* Touch Feedback */
@media (hover: none) and (pointer: coarse) {
    .btn:active {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(0.95);
    }
    
    .btn-operation:active {
        background: rgba(74, 222, 128, 0.4);
    }
    
    .btn-equals:active {
        background: rgba(74, 222, 128, 0.5);
    }
}

/* Focus Styles for Accessibility */
.btn:focus,
.nav-btn:focus,
.back-button:focus {
    outline: 2px solid #4ade80;
    outline-offset: 2px;
}