/**
 * ============================================================================
 * PIZZA CALCULATOR - CUSTOM STYLES
 * ============================================================================
 *
 * Custom styling for the pizza calculator application.
 * Built on top of the Clean Corporate Plus theme.
 *
 * @author Derrick Austin
 * @version 1.0
 */

/* ============================================================ */
/* GLOBAL STYLES */
/* ============================================================ */

body {
    background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 100%);
    min-height: 100vh;
}

.card {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: all 0.3s;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

/* ============================================================ */
/* PIZZA SIZE TOGGLE */
/* ============================================================ */

.size-toggle {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.size-button {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    background: white;
    color: #64748b;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.size-button:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.size-button.active {
    border-color: #3b82f6;
    background: #3b82f6;
    color: white;
}

/* ============================================================ */
/* PIZZA TYPE ROWS */
/* ============================================================ */

.pizza-type-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.pizza-type-row:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pizza-type-name {
    font-weight: 600;
    color: #0f172a;
    min-width: 120px;
    font-size: 1rem;
}

.pizza-type-percentage {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================================ */
/* PERCENTAGE CONTROLS */
/* ============================================================ */

.percentage-input {
    width: 80px;
    padding: 0.5rem 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
}

.percentage-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.percentage-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #dbeafe 0%, #3b82f6 100%);
    outline: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.percentage-slider:hover {
    opacity: 1;
}

/* Slider thumb styles for WebKit browsers */
.percentage-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid #3b82f6;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.percentage-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

/* Slider thumb styles for Firefox */
.percentage-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid #3b82f6;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.percentage-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

/* ============================================================ */
/* PIZZA COUNT DISPLAY */
/* ============================================================ */

.pizza-count {
    min-width: 90px;
    text-align: right;
    font-weight: 700;
    color: #3b82f6;
    font-size: 1.5rem;
    padding: 0.5rem 0.75rem;
    background: #eff6ff;
    border-radius: 0.5rem;
}

/* ============================================================ */
/* ACTION BUTTONS */
/* ============================================================ */

.remove-type-btn {
    padding: 0.5rem 0.75rem;
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
}

.remove-type-btn:hover {
    background: #fecaca;
}

.add-type-btn {
    width: 100%;
    padding: 1rem;
    background: white;
    color: #3b82f6;
    border: 2px dashed #93c5fd;
    border-radius: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.add-type-btn:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    border-style: solid;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.1);
}

/* ============================================================ */
/* INPUT LAYOUT */
/* ============================================================ */

.input-group {
    margin-bottom: 1.25rem;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.input-row > div {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.input-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    white-space: nowrap;
    min-width: fit-content;
}

.input-label-block {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 0.5rem;
}

.input-field {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
}

.input-field:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ============================================================ */
/* METRIC DISPLAY */
/* ============================================================ */

.metric-value {
    font-size: 3rem;
    font-weight: 800;
    color: #3b82f6;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 1.125rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
}

.type-summary {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #bfdbfe;
}

.type-summary-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

.type-summary-count {
    font-weight: 700;
    color: #3b82f6;
    font-size: 0.875rem;
}

/* ============================================================ */
/* PRO TIP CARD */
/* ============================================================ */

.pro-tip-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #fbbf24;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(251, 191, 36, 0.1);
}

.pro-tip-title {
    font-weight: 700;
    color: #92400e;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pro-tip-title::before {
    content: "💡";
    font-size: 1.25rem;
}

.pro-tip-text {
    color: #78350f;
    line-height: 1.6;
    font-weight: 500;
}

/* ============================================================ */
/* AUTO TYPE BADGE */
/* ============================================================ */

.auto-badge {
    display: inline-block;
    padding: 0.375rem 1rem;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid #93c5fd;
}

.make-auto-btn {
    padding: 0.25rem 0.625rem;
    background: white;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

.make-auto-btn:hover {
    background: #f8fafc;
    border-color: #3b82f6;
    color: #3b82f6;
}

.name-input {
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-weight: 600;
    color: #0f172a;
    min-width: 120px;
}

.name-input:focus {
    outline: none;
    border-color: #3b82f6;
}

/* ============================================================ */
/* TOOLTIPS */
/* ============================================================ */

.tooltip-container {
    position: relative;
    display: inline-block;
    margin-left: 0.5rem;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: help;
    transition: all 0.2s;
}

.tooltip-icon:hover {
    background: #2563eb;
    transform: scale(1.1);
}

.tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    z-index: 9999;
    left: calc(100% + 0.5rem);
    top: 50%;
    transform: translateY(-50%);
    background: #1e293b;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: normal;
    width: 320px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    transition: opacity 0.2s, visibility 0.2s;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
}

.tooltip-text::after {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    margin-top: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent #1e293b transparent transparent;
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ============================================================ */
/* RESET BUTTON */
/* ============================================================ */

.reset-btn {
    padding: 0.5rem 1rem;
    background: white;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.reset-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

/* ============================================================ */
/* HEADER */
/* ============================================================ */

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.header-actions h1 {
    margin: 0;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header {
    margin-bottom: 2rem;
}

.subtitle {
    color: #64748b;
    font-size: 1rem;
}

/* ============================================================ */
/* MOBILE RESPONSIVE STYLES */
/* ============================================================ */

@media (max-width: 768px) {
    /* Input layout switches to single column */
    .input-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Reduce header text size */
    .header h1 {
        font-size: 1.75rem;
    }

    .header .subtitle {
        font-size: 0.8rem;
    }

    /* Reduce card padding */
    .card {
        padding: 1.25rem !important;
    }

    /* Scale down metric display */
    .metric-value {
        font-size: 2.5rem;
    }

    .metric-label {
        font-size: 0.875rem;
    }

    /* Pizza type rows stack vertically */
    .pizza-type-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 1rem;
    }

    .pizza-type-name {
        min-width: auto;
    }

    .pizza-type-percentage {
        width: 100%;
    }

    .pizza-count {
        text-align: left;
        font-size: 1.25rem;
    }

    /* Reduce type summary spacing */
    .type-summary {
        gap: 1rem;
        font-size: 0.75rem;
    }

    .type-summary-item {
        font-size: 0.75rem;
    }

    /* Size buttons */
    .size-button {
        font-size: 0.75rem;
        padding: 0.625rem 0.75rem;
    }

    .size-button small {
        font-size: 0.65rem;
    }

    /* Input labels and fields */
    .input-label {
        font-size: 0.75rem;
    }

    .input-label-block {
        font-size: 0.75rem;
    }

    .input-field {
        font-size: 0.875rem;
        padding: 0.625rem;
    }

    /* Reset button */
    .reset-btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }

    /* Header actions center on mobile */
    .header-actions {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .header-actions h1 {
        width: 100%;
        text-align: center;
    }

    .header-actions .reset-btn {
        align-self: center;
    }

    /* Mobile tooltip positioning */
    .tooltip-text {
        position: absolute;
        width: 280px;
        font-size: 0.8rem;
        padding: 0.625rem 0.875rem;
        left: 50% !important;
        right: auto !important;
        top: auto !important;
        bottom: calc(100% + 0.5rem) !important;
        transform: translateX(-50%) !important;
    }

    .tooltip-text::after {
        left: 50%;
        right: auto;
        top: 100%;
        bottom: auto;
        margin-left: -5px;
        margin-top: 0;
        border-color: #1e293b transparent transparent transparent;
    }

    .tooltip-icon {
        width: 16px;
        height: 16px;
        font-size: 0.7rem;
    }

    /* Ensure tooltips aren't clipped */
    .card {
        overflow: visible !important;
    }

    .input-group {
        overflow: visible !important;
    }
}
