/**
 * Component Styles
 * Contact Form 7, Widgets, Sidebar, and Comments
 */

/* ==========================================================================
   Contact Form 7 Styles
   ========================================================================== */

.wpcf7 {
    width: 100%;
}

.wpcf7-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.wpcf7-form p {
    margin-bottom: 0;
}

.wpcf7-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #404040;
    margin-bottom: 0.5rem;
}

.wpcf7-form-control:not(.wpcf7-submit):not(.wpcf7-acceptance):not(.wpcf7-checkbox):not(.wpcf7-radio) {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid #d4d4d4;
    background-color: #fafafa;
    transition: all 0.2s ease;
    font-size: 1rem;
    line-height: 1.5;
}

.wpcf7-form-control:not(.wpcf7-submit):not(.wpcf7-acceptance):focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.1);
    background-color: #fff;
    outline: none;
}

.wpcf7-form-control.wpcf7-text,
.wpcf7-form-control.wpcf7-email,
.wpcf7-form-control.wpcf7-tel,
.wpcf7-form-control.wpcf7-url,
.wpcf7-form-control.wpcf7-number,
.wpcf7-form-control.wpcf7-date {
    height: 3rem;
}

.wpcf7-form-control.wpcf7-textarea {
    min-height: 150px;
    resize: vertical;
}

.wpcf7-form-control.wpcf7-select {
    height: 3rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23737373'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 3rem;
}

/* Checkboxes and Radio */
.wpcf7-form-control.wpcf7-checkbox,
.wpcf7-form-control.wpcf7-radio {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.wpcf7-list-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 !important;
}

.wpcf7-list-item input[type="checkbox"],
.wpcf7-list-item input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.25rem;
    border: 1px solid #d4d4d4;
    accent-color: #0284c7;
    cursor: pointer;
}

.wpcf7-list-item input[type="radio"] {
    border-radius: 50%;
}

.wpcf7-list-item-label {
    font-size: 0.875rem;
    color: #525252;
}

/* Acceptance */
.wpcf7-acceptance {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.wpcf7-acceptance input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.25rem;
    border: 1px solid #d4d4d4;
    accent-color: #0284c7;
    cursor: pointer;
    flex-shrink: 0;
}

/* Submit Button */
.wpcf7-form-control.wpcf7-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 500;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(2, 132, 199, 0.25);
}

.wpcf7-form-control.wpcf7-submit:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    box-shadow: 0 10px 15px -3px rgba(2, 132, 199, 0.3);
    transform: translateY(-1px);
}

.wpcf7-form-control.wpcf7-submit:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.5);
}

.wpcf7-form-control.wpcf7-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* File Upload */
.wpcf7-form-control.wpcf7-file {
    padding: 0.5rem;
}

.wpcf7-form-control.wpcf7-file::file-selector-button {
    margin-right: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: none;
    font-size: 0.875rem;
    font-weight: 600;
    background-color: #e0f2fe;
    color: #0369a1;
    cursor: pointer;
    transition: background-color 0.2s;
}

.wpcf7-form-control.wpcf7-file::file-selector-button:hover {
    background-color: #bae6fd;
}

/* Validation States */
.wpcf7-not-valid {
    border-color: #ef4444 !important;
}

.wpcf7-not-valid:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1) !important;
}

.wpcf7-not-valid-tip {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Response Messages */
.wpcf7-response-output {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.wpcf7-response-output.wpcf7-validation-errors,
.wpcf7-response-output.wpcf7-aborted {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.wpcf7-response-output.wpcf7-mail-sent-ok {
    background-color: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.wpcf7-response-output.wpcf7-spam-blocked {
    background-color: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

/* Spinner */
.wpcf7-spinner {
    margin-left: 1rem;
    display: inline-block;
}

.wpcf7 .ajax-loader {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    margin-left: 0.75rem;
}

/* ==========================================================================
   Widget Styles
   ========================================================================== */

.widget-area {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.widget {
    background: #fff;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e5e5;
}

.widget-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #171717;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #0284c7;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Widget Lists */
.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f5f5f5;
}

.widget ul li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.widget ul li a {
    color: #525252;
    text-decoration: none;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.widget ul li a:hover {
    color: #0284c7;
}

/* Widget with counts */
.widget ul li a .count,
.widget ul li a span:last-child {
    background: #f5f5f5;
    color: #737373;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

/* Search Widget */
.widget_search .search-form {
    display: flex;
    gap: 0.5rem;
}

.widget_search .search-field {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #d4d4d4;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: #fafafa;
    transition: all 0.2s;
}

.widget_search .search-field:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
    background: #fff;
}

.widget_search .search-submit {
    padding: 0.75rem 1rem;
    background: #0284c7;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.widget_search .search-submit:hover {
    background: #0369a1;
}

/* Recent Posts Widget */
.widget_recent_entries ul li {
    padding: 0.75rem 0;
}

.widget_recent_entries ul li a {
    display: block;
    font-weight: 500;
    color: #262626;
    margin-bottom: 0.25rem;
}

.widget_recent_entries ul li .post-date {
    font-size: 0.75rem;
    color: #737373;
}

/* Categories Widget */
.widget_categories ul li {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Tag Cloud */
.widget_tag_cloud .tagcloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.widget_tag_cloud .tagcloud a {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #f5f5f5;
    color: #525252;
    border-radius: 9999px;
    font-size: 0.75rem !important;
    text-decoration: none;
    transition: all 0.2s;
}

.widget_tag_cloud .tagcloud a:hover {
    background: #0284c7;
    color: #fff;
}

/* Calendar Widget */
.widget_calendar table {
    width: 100%;
    border-collapse: collapse;
}

.widget_calendar caption {
    font-weight: 600;
    padding: 0.5rem 0;
}

.widget_calendar th,
.widget_calendar td {
    text-align: center;
    padding: 0.5rem;
    font-size: 0.875rem;
}

.widget_calendar th {
    color: #737373;
    font-weight: 500;
}

.widget_calendar td a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: #0284c7;
    color: #fff;
    border-radius: 50%;
    text-decoration: none;
}

/* ==========================================================================
   Sidebar Layout
   ========================================================================== */

.content-sidebar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 1024px) {
    .content-sidebar {
        grid-template-columns: 1fr 320px;
    }
}

.content-sidebar .content-area {
    min-width: 0;
}

.content-sidebar .widget-area {
    position: sticky;
    top: 6rem;
    align-self: start;
}

/* ==========================================================================
   Comments Styles
   ========================================================================== */

.comments-area .comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comments-area .comment-list .children {
    list-style: none;
    padding-left: 2rem;
    margin-top: 1rem;
}

.comments-area .comment-respond {
    margin-top: 2rem;
}

.comments-area .comment-form > p {
    margin-bottom: 1rem;
}

.comments-area .comment-form > p:last-of-type {
    margin-bottom: 0;
}

/* Comment form fields layout */
.comment-form-author,
.comment-form-email,
.comment-form-url {
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .comment-form .comment-form-author,
    .comment-form .comment-form-email {
        display: inline-block;
        width: calc(50% - 0.5rem);
    }

    .comment-form .comment-form-author {
        margin-right: 1rem;
    }
}
