/* Calc.css - Scope all styles under .clc-app to prevent side effects on other pages */

.clc-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #2d3748;
    max-width: 440px;
    margin: 10px auto 30px auto;
    padding: 0 10px;
}

.clc-app * {
    box-sizing: border-box;
}

/* Header Banner */
.clc-app .clc-header {
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
    color: #ffffff;
    padding: 20px 24px;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 10px 25px rgba(2, 132, 199, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.clc-app .clc-header-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
}

.clc-app .clc-header-subtitle {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 2px 0 0 0;
}

/* Main Display Box */
.clc-app .clc-display-box {
    background: #0f172a;
    padding: 20px 24px;
    text-align: right;
    border-bottom: 2px solid #1e293b;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100px;
    position: relative;
}

.clc-app #num_txt {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #38bdf8;
    font-size: 2.2rem;
    font-weight: 700;
    font-family: SFMono-Regular, Consolas, monospace;
    text-align: right;
    letter-spacing: -0.02em;
}

/* Copy button */
.clc-app .clc-btn-copy {
    position: absolute;
    top: 10px;
    left: 14px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clc-app .clc-btn-copy:hover {
    background: rgba(56, 189, 248, 0.25);
    color: #ffffff;
}

/* Main Keypad Panel */
.clc-app #mainPanel {
    background: #1e293b;
    padding: 16px;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.25);
}

.clc-app #mainPanel > div {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.clc-app #mainPanel > div:last-child {
    margin-bottom: 0;
}

.clc-app #mainPanel button {
    height: 56px;
    width: 100%;
    font-size: 1.25rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #334155;
    color: #f8fafc;
}

.clc-app #mainPanel button:hover {
    background: #475569;
}

.clc-app #mainPanel button:active {
    transform: scale(0.95);
}

/* Special Button Styles */
.clc-app #mainPanel button[value="C"],
.clc-app #mainPanel button[value="H"],
.clc-app #mainPanel button[value="BS"] {
    background: #475569;
    color: #cbd5e1;
    font-size: 1.05rem;
}

.clc-app #mainPanel button[value="C"]:hover,
.clc-app #mainPanel button[value="H"]:hover,
.clc-app #mainPanel button[value="BS"]:hover {
    background: #64748b;
    color: #ffffff;
}

.clc-app #mainPanel button[value="*"],
.clc-app #mainPanel button[value="/"],
.clc-app #mainPanel button[value="+"],
.clc-app #mainPanel button[value="-"] {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    font-size: 1.4rem;
}

.clc-app #mainPanel button[value="*"]:hover,
.clc-app #mainPanel button[value="/"]:hover,
.clc-app #mainPanel button[value="+"]:hover,
.clc-app #mainPanel button[value="-"]:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
}

.clc-app #mainPanel button[value="="] {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    color: #ffffff;
    font-size: 1.5rem;
}

.clc-app #mainPanel button[value="="]:hover {
    background: linear-gradient(135deg, #c2410c 0%, #9a3412 100%);
}

/* How to Guide Card */
.clc-app #howto {
    margin-top: 16px;
    background: #ffffff;
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 0.825rem;
    line-height: 1.6;
    color: #64748b;
    border: 1px solid #edf2f7;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.clc-app #howto strong {
    color: #334155;
}

/* Toast Notification */
.clc-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #2d3748;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 9999;
}

.clc-toast.show {
    opacity: 1;
    transform: translateY(0);
}
