/* ========== SHARED BASE STYLES ========== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Common body styling for tool pages */
body {
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
    color: #e94560;
    font-family: 'Courier New', monospace;
    margin: 0;
    padding: clamp(12px, 4vw, 20px);
    min-height: 100vh;
}

/* Main container */
.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #e94560;
    border-radius: 10px;
    padding: clamp(16px, 4vw, 30px);
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.3);
}

/* Headers */
h1 {
    text-align: center;
    font-size: clamp(1.45rem, 5vw, 2.5em);
    margin-bottom: 10px;
    text-shadow: 0 0 10px #e94560;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.subtitle {
    text-align: center;
    color: #888;
    margin-bottom: 30px;
    font-style: italic;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

/* Input sections */
.input-section {
    background: rgba(233, 69, 96, 0.1);
    border: 1px solid #e94560;
    border-radius: 8px;
    padding: clamp(14px, 3vw, 25px);
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 20px;
    min-width: 0;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

/* Form elements */
label {
    color: #e94560;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 14px;
    display: block;
}

input[type="text"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px;
    background: #000;
    border: 1px solid #e94560;
    border-radius: 5px;
    color: #e94560;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    box-sizing: border-box;
    min-width: 0;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #ff6b8a;
    box-shadow: 0 0 5px rgba(233, 69, 96, 0.5);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* Buttons */
button,
.btn {
    min-height: 44px;
    padding: 12px clamp(14px, 3vw, 25px);
    background: #e94560;
    color: #000;
    border: none;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

button:hover,
.btn:hover {
    background: #ff6b8a;
    transform: scale(1.05);
}

button:disabled,
.btn:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

/* Primary action buttons */
.primary-btn {
    width: 100%;
    padding: 15px;
    font-size: 18px;
}

.primary-btn:hover {
    transform: scale(1.02);
}

/* Examples section */
.examples {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    padding: 15px;
    margin-top: 20px;
}

.example-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 8px 0;
    border-bottom: 1px solid #333;
}

.example-row:last-child {
    border-bottom: none;
}

.example-btn {
    padding: 5px 10px;
    background: transparent;
    border: 1px solid #e94560;
    color: #e94560;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
    flex: 0 0 auto;
}

.example-btn:hover {
    background: #e94560;
    color: #000;
}

/* Output section */
.output-section {
    background: #000;
    border: 1px solid #e94560;
    border-radius: 8px;
    padding: clamp(14px, 3vw, 20px);
    min-width: 0;
}

.json-output {
    background: #111;
    border: 1px solid #333;
    border-radius: 5px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    white-space: pre-wrap;
    color: #0f0;
    min-height: 150px;
    overflow-x: auto;
    overflow-wrap: anywhere;
    max-width: 100%;
}

/* Status classes */
.loading {
    color: #e94560;
}

.error {
    color: #ff4444;
}

.success {
    color: #00ff88;
}

/* [CLEANUP] Redundant certificate styles removed to prevent conflicts with cert-card.css */
/*
.certificate-viewer {
    display: flex;
    ...
}
*/

.loading-container {
    text-align: center;
    font-size: 1.5em;
    color: #ffd700;
    margin: 50px 0;
}

.error-container {
    text-align: center;
    color: #ff4444;
    padding: 20px;
    border: 1px solid #ff4444;
    border-radius: 8px;
    background: rgba(255, 68, 68, 0.1);
}

/* Back link */
.back-link {
    text-align: center;
    margin-top: 30px;
}

.back-link a {
    color: #e94560;
    text-decoration: none;
    border: 1px solid #e94560;
    padding: 10px 20px;
    border-radius: 5px;
    transition: all 0.3s;
}

.back-link a:hover {
    background: #e94560;
    color: #000;
}

.language-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 600px) {
    .container {
        padding: 14px;
        border-width: 1px;
    }

    .input-section {
        margin-bottom: 18px;
    }

    .input-section h3,
    .output-section h3 {
        font-size: 1rem;
        line-height: 1.5;
    }

    .input-group {
        flex-direction: column;
    }

    .input-group button {
        width: 100%;
    }

    .language-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .example-row {
        align-items: stretch;
    }

    .example-row > span,
    .example-text {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .example-row .example-btn {
        width: 100%;
    }

    .json-output {
        font-size: 12px;
        padding: 10px;
    }

    .back-link a {
        display: inline-block;
        max-width: 100%;
        padding: 10px 12px;
        line-height: 1.5;
    }
}