/* 
   components.css ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â Reusable UI components for mitchbarrie.net
   Loaded by tool pages, video pages, and any page with
   interactive widgets or card-style containers.
   
   Contains: card containers, buttons, form elements,
   control panels, tool-specific items (snake oil, phrases,
   quotes), video embeds, and their mobile breakpoints.
*/

/* ---- Card Containers ---- */

.converter-container,
.quote-container,
.video-container {
    background-color: var(--section-bg);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* ---- Intro Text ---- */

.phrase-intro,
.snake-oil-intro,
.video-intro,
.password-intro,
.filename-intro,
.case-changer-intro {
    margin-bottom: 25px;
}

/* ---- Form Elements ---- */

.textarea-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.textarea-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.converter-textarea {
    width: 100%;
    height: 150px;
    padding: 0.75rem;
    font-family: 'Noto Sans', sans-serif;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    resize: vertical;
}

.converter-textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(44, 114, 176, 0.2);
}

.focus-highlight {
    border: 2px solid var(--accent-color) !important;
}

.warning-message {
    color: #d94e4e;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: none;
}

/* ---- Buttons ---- */

.converter-button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.converter-button:hover {
    background-color: var(--link-hover);
}

.button-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.clear-button {
    background-color: #777;
}

.clear-button:hover {
    background-color: #555;
}

/* ---- Control Panels ---- */

.control-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.count-selector {
    display: flex;
    align-items: center;
}

.count-selector label {
    margin-right: 0.5rem;
    font-weight: 600;
}

.count-selector select {
    padding: 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.separator-selector {
    margin-right: 15px;
}

/* ---- Snake Oil Generator ---- */

.snake-oil-item {
    padding: 0.75rem;
    background-color: rgba(44, 114, 176, 0.05);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    transition: background-color 0.2s;
}

.snake-oil-item:hover {
    background-color: rgba(44, 114, 176, 0.1);
}

#snake-oil-count {
    width: auto;
    height: auto;
    padding: 0.4rem;
}

#snake-oil-list {
    margin-top: 1.5rem;
}

/* ---- Quote Generator ---- */

.quote-text {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 3rem;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 4px;
    border-left: 3px solid var(--accent-color);
    font-style: italic;
    min-height: 120px;
}

#new-quote-btn {
    margin-top: 1rem;
}

/* ---- Phrase Generator ---- */

.phrase-item {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 5px;
    font-size: 16px;
    transition: background-color 0.3s;
}

.phrase-item.flash-highlight {
    background-color: #ffffdd;
}

.phrase-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.phrase-row:last-child {
    margin-bottom: 0;
}

.phrase-label {
    font-weight: bold;
    width: 120px;
}

.phrase-text {
    flex-grow: 1;
    word-break: break-word;
}

.copy-btn {
    margin-left: 10px;
    cursor: pointer;
    color: #555;
    background: none;
    border: none;
    font-size: 18px;
}

.copy-btn:hover {
    color: #000;
}

/* ---- Strong Password Generator ---- */

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0 1rem 0;
}

.options-fieldset {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.75rem 1rem;
}

.options-fieldset legend {
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0 0.4rem;
    color: var(--text-color);
}

.checkbox-label {
    display: block;
    margin-bottom: 0.4rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.checkbox-label:last-child {
    margin-bottom: 0;
}

.checkbox-label input[type="checkbox"],
.checkbox-label input[type="radio"] {
    margin-right: 0.4rem;
    cursor: pointer;
}

.option-hint {
    color: var(--muted-text);
    font-size: 0.85rem;
}

.length-input {
    width: 60px;
    padding: 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Noto Sans', sans-serif;
    font-size: 0.95rem;
    text-align: center;
}

.length-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(44, 114, 176, 0.2);
}

.password-output {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95rem;
    height: auto;
    min-height: 100px;
    line-height: 1.8;
}

.save-prefs {
    margin-bottom: 1rem;
    padding-top: 0.25rem;
}

/* ---- Filename Maker ---- */

.filename-output {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95rem;
}

/* ---- Video Embeds ---- */

.video-date {
    font-size: 0.9em;
    color: #777;
    margin-bottom: 10px;
    display: block;
}

.video-description {
    margin-top: 15px;
    margin-bottom: 20px;
}

.video-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ---- Mobile ---- */

@media (max-width: 768px) {
    .video-container {
        padding: 15px;
    }
    
    .control-panel {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
}

@media (max-width: 600px) {
    .phrase-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .phrase-label {
        margin-bottom: 5px;
        width: 100%;
    }
    
    .copy-btn {
        margin-top: 5px;
        margin-left: 0;
    }
}
