:root {
    --bg-color: #0f172a;
    --calc-bg: rgba(30, 41, 59, 0.7);
    --display-bg: rgba(15, 23, 42, 0.5);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --btn-bg: #334155;
    --btn-hover: #475569;
    --operator-color: #f59e0b;
    --operator-hover: #fbbf24;
    --equal-bg: linear-gradient(135deg, #f59e0b, #ea580c);
    --secondary-btn: #475569;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background: var(--bg-color);
    background-image: radial-gradient(circle at top left, #1e293b, #0f172a);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-primary);
}

.calculator-container {
    perspective: 1000px;
}

.calculator {
    background: var(--calc-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 350px;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.calculator:hover {
    transform: translateY(-5px);
}

.display {
    background: var(--display-bg);
    margin-bottom: 25px;
    padding: 20px;
    border-radius: 20px;
    text-align: right;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    word-wrap: break-word;
    word-break: break-all;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.previous-operand {
    color: var(--text-secondary);
    font-size: 1.1rem;
    height: 1.5rem;
}

.current-operand {
    font-size: 2.5rem;
    font-weight: 600;
    overflow: hidden;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.btn {
    cursor: pointer;
    border: none;
    border-radius: 18px;
    height: 60px;
    font-size: 1.25rem;
    font-weight: 500;
    background: var(--btn-bg);
    color: var(--text-primary);
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn:hover {
    background: var(--btn-hover);
    transform: scale(1.05);
}

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

.btn.operator {
    color: var(--operator-color);
    font-weight: 700;
    font-size: 1.5rem;
}

.btn.secondary {
    background: var(--secondary-btn);
    color: #cbd5e1;
}

.btn.equal {
    background: var(--equal-bg);
    color: white;
    font-weight: 700;
}

.span-two {
    grid-column: span 2;
}

.btn-secret {
    margin-top: 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 8px 15px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    align-self: center;
    transition: all 0.2s ease;
}

.btn-secret:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

/* Scrollbar styles for the display if needed */
.display::-webkit-scrollbar {
    width: 5px;
}
.display::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.modal-content-text {
    background-color: #1e293b;
    margin: auto;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 80%;
    max-width: 300px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    position: relative;
    text-align: center;
    color: var(--text-primary);
}

.modal-content-text h2 {
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: var(--operator-color);
}

.modal-content-text ul {
    list-style: none;
    padding: 0;
}

.modal-content-text li {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 10px 0;
    letter-spacing: 2px;
}

/* Camera Modal Styles */
.modal-content-camera {
    background-color: #1e293b;
    margin: auto;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    position: relative;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.camera-view {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 4/3;
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    margin: 15px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#camera-feed, #sticker-result {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror effect */
}

.camera-controls {
    display: flex;
    gap: 15px;
    width: 100%;
    justify-content: center;
}

.btn-action {
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.2s;
}

#snap-btn {
    background: var(--operator-color);
    color: #000;
}
#snap-btn:hover { background: var(--operator-hover); }

#retake-btn {
    background: var(--secondary-btn);
    color: #fff;
}

#download-btn {
    background: #10b981;
    color: #fff;
}
#download-btn:hover { background: #059669; }


.close-btn {
    color: var(--text-secondary);
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    z-index: 100;
}

.close-btn:hover {
    color: var(--text-primary);
}