/* Scoped Styles for Hours Math Calculator Plugin */

.hmc-app *,
.hmc-app *::before,
.hmc-app *::after {
    box-sizing: border-box;
}

.hmc-app {
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    color: #132038;
    width: 100%;
    background: transparent;
    padding: 0;
    margin: 0 auto;
}

.hmc-app .header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}

.hmc-app .header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.hmc-app .title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.hmc-app .subtitle {
    margin: 2px 0 0;
    font-size: 13px;
    color: #4b5563;
}

.hmc-app .note {
    font-size: 12px;
    color: #6b7280;
}

.hmc-app .card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease;
}

.hmc-app .card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.hmc-app .card-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 2px solid #e5e7eb;
}

.hmc-app .card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.01em;
}

.hmc-app .card-body {
    padding: 20px;
}

.hmc-app .time-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hmc-app .time-inputs-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.hmc-app .input-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.hmc-app input[type="time"],
.hmc-app input[type="date"],
.hmc-app input[type="week"],
.hmc-app input[type="month"],
.hmc-app input[type="number"] {
    width: 100%;
    padding: 11px 14px;
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    background: #fff;
    font-size: 14px;
    color: #0b1726;
    outline: none;
    transition: all 0.2s ease;
    margin: 0;
}

.hmc-app input:hover {
    border-color: #cbd5e1;
}

.hmc-app input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: #fafbfc;
}

.hmc-app .math-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.hmc-app .math-operator {
    font-weight: bold;
    font-size: 18px;
    color: #667eea;
    width: 20px;
    text-align: center;
}

.hmc-app .time-separator {
    font-weight: bold;
    color: #475569;
}

.hmc-app .result-row {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px dashed #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.hmc-app .result-main {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}

.hmc-app .result-big {
    font-size: 28px;
    font-weight: 800;
    color: #1e293b;
}

.hmc-app .result-decimal {
    font-size: 14px;
    color: #64748b;
    font-weight: 600;
}

/* Input specificity for center align */
.hmc-app .time-inputs-row input {
    width: 70px;
    text-align: center;
}

.hmc-app #hmc-additionRows {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.hmc-app .add-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hmc-app .remove-row-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 18px;
    line-height: 1;
}

.hmc-app .remove-row-btn:hover {
    background: #fef2f2;
}

/* 3-Column Result Grid for Addition */
.hmc-app .result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 15px;
    border-top: 2px dashed #e5e7eb;
    padding-top: 15px;
    text-align: center;
}

.hmc-app .result-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hmc-app .result-box .result-title {
    font-size: 11px;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 600;
}

.hmc-app .result-box .value {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.hmc-app button {
    border: 2px solid #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 11px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    line-height: 1.2;
}

.hmc-app button:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    border-color: #5568d3;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.hmc-app button:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(102, 126, 234, 0.2);
}

.hmc-app button.secondary {
    background: #ffffff;
    color: #475569;
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    font-size: 13px;
    padding: 10px 14px;
}

.hmc-app button.secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.hmc-app button.ghost {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: #475569;
    border: 2px dashed #cbd5e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    width: 100%;
    margin-top: 4px;
    white-space: normal;
    text-align: center;
}

.hmc-app button.ghost:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-color: #94a3b8;
    border-style: solid;
    color: #334155;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.hmc-app .footer-note {
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    margin-top: 20px;
}

/* Print styles */
@media print {
    .hmc-app {
        box-shadow: none !important;
        border: none !important;
        max-width: 100% !important;
    }
}

/* Mobile optimization */
@media (max-width: 640px) {
    .hmc-app button {
        width: 100%;
        font-size: 13px;
        padding: 12px 14px;
    }

    .hmc-app button.secondary {
        font-size: 12.5px;
    }
}

/* Ultra small devices */
@media (max-width: 360px) {
    .hmc-app button {
        font-size: 12px;
        padding: 10px 12px;
    }
}