/**
 * Frontend Form Styles for Your Temporary Link Generator
 */

.ytlg-form-container {
    max-width: 400px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    margin: 20px auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.ytlg-form-container .ytlg-form-title {
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.4em;
    font-weight: 600;
    color: #2c3e50;
}

.ytlg-form-container .ytlg-field {
    margin-bottom: 15px;
}

.ytlg-form-container .ytlg-field label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.95em;
    font-weight: 600;
    color: #555;
}

.ytlg-form-container .ytlg-field label .ytlg-required {
    color: #e74c3c;
    font-weight: bold;
    margin-left: 2px;
}

.ytlg-form-container .ytlg-field input[type="url"],
.ytlg-form-container .ytlg-field input[type="number"], /* Added for number input */
.ytlg-form-container .ytlg-field select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 0.95em;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.ytlg-form-container .ytlg-field input[type="url"]:focus,
.ytlg-form-container .ytlg-field input[type="number"]:focus, /* Added for number input */
.ytlg-form-container .ytlg-field select:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
    outline: none;
}

.ytlg-form-container .ytlg-validity-group {
    display: flex;
    align-items: center;
}
.ytlg-form-container .ytlg-validity-group input[type="number"] {
    width: 100px; /* Specific width for the number input */
    margin-right: 10px;
    flex-grow: 0; /* Don't grow */
    flex-shrink: 0; /* Don't shrink */
}
.ytlg-form-container .ytlg-validity-group select {
    flex-grow: 1; /* Allow select to take remaining space */
}

.ytlg-form-container .description-small {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
    line-height: 1.3;
}


.ytlg-form-container .ytlg-button {
    width: 100%;
    padding: 12px 15px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: background-color 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ytlg-form-container .ytlg-button:hover,
.ytlg-form-container .ytlg-button:focus {
    background-color: #005a87;
    outline: none;
}

.ytlg-form-container .ytlg-button .ytlg-loader {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: ytlg-spin 1s ease-in-out infinite;
    margin-left: 8px;
}

@keyframes ytlg-spin {
    to { transform: rotate(360deg); }
}

.ytlg-form-container .ytlg-generated-link-container {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.ytlg-form-container .ytlg-generated-link-container p {
    margin-bottom: 8px;
    font-size: 0.9em;
    font-weight: 600;
    color: #333;
}

.ytlg-form-container .ytlg-input-group {
    display: flex;
    align-items: center;
}

.ytlg-form-container .ytlg-generated-link-container input[type="text"] {
    flex-grow: 1;
    padding: 10px;
    margin-right: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    font-size: 0.95em;
    color: #333;
}
.ytlg-form-container .ytlg-generated-link-container input[type="text"]:read-only {
    background-color: #f0f0f0;
}

.ytlg-form-container .ytlg-button-small {
    padding: 0; /* Reset padding */
    width: 40px; /* Fixed width for icon button */
    height: 40px; /* Fixed height for icon button */
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    line-height: 1;
    transition: background-color 0.2s ease-in-out;
    display: inline-flex; /* For centering icon */
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevent shrinking */
}
.ytlg-form-container .ytlg-button-small .dashicons {
    font-size: 20px; /* Adjust icon size */
    line-height: 1;
    height: auto;
    width: auto;
}

.ytlg-form-container .ytlg-button-small:hover {
    background-color: #45a049;
}

.ytlg-form-container .ytlg-message {
    margin-top: 15px;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 0.95em;
    text-align: center;
    display: none; /* Initially hidden, shown by JS */
}

.ytlg-form-container .ytlg-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ytlg-form-container .ytlg-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.ytlg-form-container .ytlg-message.info { /* For general info messages */
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}


@media (max-width: 480px) {
    .ytlg-form-container {
        padding: 15px;
    }
    .ytlg-form-container .ytlg-form-title {
        font-size: 1.2em;
    }
    .ytlg-form-container .ytlg-field input[type="url"],
    .ytlg-form-container .ytlg-field input[type="number"],
    .ytlg-form-container .ytlg-field select,
    .ytlg-form-container .ytlg-button {
        font-size: 0.9em;
    }
    .ytlg-form-container .ytlg-generated-link-container input[type="text"] {
        font-size: 0.9em;
    }
    .ytlg-form-container .ytlg-validity-group input[type="number"] {
        width: 70px;
    }
}