/* microblog.css */

/* General form styling */
.microblog-form-container {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    max-width: 600px;
    margin: 30px auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

#microblog-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Textarea styling */
#microblog-content {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #dcdcdc;
    border-radius: 5px;
    font-size: 16px;
    line-height: 1.5;
    min-height: 100px;
    resize: vertical;
    box-sizing: border-box; /* Ensures padding is included in the width */
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

#microblog-content:focus {
    border-color: #0073aa; /* WordPress primary blue */
    box-shadow: 0 0 0 1px #0073aa;
    outline: none;
}

/* Character counter styling */
.microblog-char-counter {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    text-align: right;
    padding-right: 5px;
}

.microblog-char-counter[style*="color: rgb(255, 107, 107)"] { /* Over 280 chars */
    color: #ff6b6b !important;
    font-weight: bold;
}

.microblog-char-counter[style*="color: rgb(255, 165, 0)"] { /* Over 240 chars */
    color: #ffa500 !important;
}

/* Select dropdown styling */
#microblog-category {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #dcdcdc;
    border-radius: 5px;
    font-size: 16px;
    background-color: #fcfcfc;
    cursor: pointer;
    appearance: none; /* Remove default arrow on some browsers */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23666666"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
    transition: border-color 0.2s ease-in-out;
}

#microblog-category:focus {
    border-color: #0073aa;
    outline: none;
}

/* Submit button styling */
input[type="submit"] {
    background-color: #0073aa;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    padding: 12px 25px;
    font-size: 17px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, opacity 0.2s ease-in-out;
    width: auto; /* Adjust width to content */
    align-self: flex-end; /* Align button to the right */
}

input[type="submit"]:hover {
    background-color: #006799;
}

input[type="submit"]:disabled {
    background-color: #a0a0a0;
    cursor: not-allowed;
    opacity: 0.7;
}

/* WordPress-style notice messages */
.microblog-messages {
    margin-bottom: 20px;
}

.microblog-messages .notice {
    padding: 12px 20px;
    margin: 0 0 15px 0;
    border-left: 4px solid;
    border-radius: 4px;
    position: relative;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    word-wrap: break-word; /* Ensure long messages wrap */
}

.microblog-messages .notice p {
    margin: 0;
    padding: 0;
    font-size: 15px;
    line-height: 1.4;
    flex-grow: 1;
}

.microblog-messages .notice-success {
    border-color: #46b450; /* Green */
    background-color: #e6ffe6; /* Light green background */
    color: #388e3c; /* Darker green text */
}

.microblog-messages .notice-error {
    border-color: #dc3232; /* Red */
    background-color: #ffe6e6; /* Light red background */
    color: #d32f2f; /* Darker red text */
}

.microblog-messages .notice-info {
    border-color: #0073aa; /* Blue */
    background-color: #e7f7ff; /* Light blue background */
    color: #005f88; /* Darker blue text */
}

.microblog-messages .notice-dismiss {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    color: #999;
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    transition: color 0.2s ease-in-out;
}

.microblog-messages .notice-dismiss:hover {
    color: #333;
}

.microblog-messages .notice .screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    -webkit-clip-path: inset(50%);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* Microblog list display styling */
.microblog-list {
    margin-top: 30px;
}

.microblog-entry {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.microblog-entry h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 20px;
    color: #333333;
    line-height: 1.3;
}

.microblog-content p {
    margin-bottom: 10px;
    font-size: 15px;
    line-height: 1.6;
    color: #444444;
}

.microblog-meta {
    font-size: 13px;
    color: #777777;
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-top: 15px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .microblog-form-container {
        margin: 20px 15px;
        padding: 20px;
    }

    input[type="submit"] {
        width: 100%;
        align-self: center;
    }
}
