/**
 * SmartClassified Public CSS
 * Fil: public/css/public-style.css
 */

/* === Global Styles === */
.sc-button {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.sc-button-primary {
    background: #0073aa;
    color: #fff;
}

.sc-button-primary:hover {
    background: #005a87;
}

.sc-notice {
    padding: 15px;
    margin: 15px 0;
    border-radius: 5px;
}

.sc-notice.sc-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.sc-notice.sc-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

/* === Login Forms === */
.sc-login-form-wrapper {
    max-width: 450px;
    margin: 0 auto;
    padding: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

.sc-login-form h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 30px;
    color: #333;
}

.sc-login-form .sc-form-checkbox {
    margin: 10px 0 20px 0;
}

.sc-login-form .sc-form-checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.sc-button-block {
    width: 100%;
    text-align: center;
}

.sc-form-links {
    text-align: center;
    margin-top: 15px;
}

.sc-forgot-password {
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
}

.sc-forgot-password:hover {
    text-decoration: underline;
}

.sc-notice.sc-error {
    background: #fcf0f1;
    border: 1px solid #d63638;
    color: #d63638;
}

/* === Field Icons === */
.sc-field-icon {
    font-size: 18px;
    margin-right: 5px;
}

/* === Registration Form === */
.sc-registration-form {
    max-width: 500px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.sc-form-group {
    margin-bottom: 20px;
}

.sc-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.sc-form-group input,
.sc-form-group select,
.sc-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* === Profile Dashboard === */
.sc-profile-dashboard {
    display: flex;
    gap: 30px;
    margin: 20px 0;
}

.sc-profile-nav {
    flex: 0 0 200px;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.sc-profile-nav a {
    display: block;
    padding: 12px 15px;
    margin-bottom: 5px;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.sc-profile-nav a:hover,
.sc-profile-nav a.active {
    background: #0073aa;
    color: #fff;
}

.sc-profile-content {
    flex: 1;
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.sc-dashboard-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.sc-overview-box {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #0073aa;
}

.sc-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sc-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.sc-table th,
.sc-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.sc-table th {
    background: #f8f9fa;
    font-weight: 600;
}

/* === Search Bar === */
.sc-search-bar {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.sc-search-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.sc-search-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 14px;
}

.sc-search-field input,
.sc-search-field select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.sc-search-submit {
    display: flex;
    align-items: flex-end;
}

/* === Ads Grid === */
.sc-ads-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin: 30px 0;
}

.sc-ads-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.sc-ads-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .sc-ads-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sc-ads-grid {
        grid-template-columns: 1fr;
    }
}

.sc-ad-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sc-ad-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.sc-ad-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.sc-ad-thumbnail {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.sc-ad-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sc-online-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.sc-online-indicator.online {
    background: #28a745;
    color: #fff;
}

.sc-online-indicator.offline {
    background: #6c757d;
    color: #fff;
}

.sc-ad-card-content {
    padding: 20px;
}

.sc-ad-title {
    font-size: 18px;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.sc-ad-location {
    color: #666;
    font-size: 14px;
    margin: 5px 0;
}

.sc-ad-excerpt {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    margin: 15px 0;
}

.sc-ad-meta-footer {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #888;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* === Single Ad === */
.sc-single-ad {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    margin: 30px 0;
}

.sc-ad-header {
    grid-column: 1 / -1;
}

.sc-ad-header h1 {
    margin: 0 0 15px 0;
}

.sc-ad-meta {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 14px;
}

.sc-ad-featured-image {
    margin: 20px 0;
}

.sc-ad-featured-image img {
    width: 100%;
    border-radius: 8px;
}

.sc-ad-description {
    line-height: 1.8;
    margin: 20px 0;
}

.sc-ad-fields {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.sc-ad-details {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 10px;
}

.sc-ad-details dt {
    font-weight: 600;
}

.sc-ad-sidebar {
    grid-column: 2;
    grid-row: 2 / -1;
}

.sc-ad-author-box,
.sc-ad-contact {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.sc-author-avatar {
    text-align: center;
    margin-bottom: 15px;
}

.sc-author-avatar img {
    border-radius: 50%;
}

.sc-ad-author-box h3 {
    text-align: center;
    margin: 10px 0 20px 0;
}

/* === Status Dots === */
.sc-status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 5px;
}

.sc-status-dot.online {
    background: #28a745;
    box-shadow: 0 0 5px #28a745;
}

.sc-status-dot.offline {
    background: #6c757d;
}

/* === Chat System === */
.sc-chat-widget {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 400px;
    height: 500px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
    display: none;
    flex-direction: column;
    z-index: 9999;
}

.sc-chat-widget.active {
    display: flex;
}

.sc-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #0073aa;
    color: #fff;
    border-radius: 10px 10px 0 0;
}

.sc-chat-header h3 {
    margin: 0;
    font-size: 16px;
}

.sc-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.sc-chat-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
}

.sc-chat-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.sc-chat-tab.active {
    border-bottom: 2px solid #0073aa;
    color: #0073aa;
}

.sc-chat-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.sc-chat-tab-content {
    display: none;
    height: 100%;
    overflow-y: auto;
}

.sc-chat-tab-content.active {
    display: block;
}

.sc-conversation-item {
    display: flex;
    gap: 10px;
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s ease;
}

.sc-conversation-item:hover {
    background: #f8f9fa;
}

.sc-conv-avatar {
    position: relative;
}

.sc-conv-avatar img {
    border-radius: 50%;
}

.sc-conv-avatar .sc-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
}

.sc-conv-info {
    flex: 1;
}

.sc-conv-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.sc-conv-last-message {
    font-size: 13px;
    color: #666;
}

.sc-conv-unread {
    background: #0073aa;
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.sc-messages-container {
    height: calc(100% - 100px);
    overflow-y: auto;
    padding: 15px;
}

.sc-message {
    margin-bottom: 15px;
    display: flex;
}

.sc-message.mine {
    justify-content: flex-end;
}

.sc-message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 18px;
    background: #f1f3f5;
}

.sc-message.mine .sc-message-bubble {
    background: #0073aa;
    color: #fff;
}

.sc-message-input-area {
    display: flex;
    gap: 10px;
    padding: 15px;
    border-top: 1px solid #ddd;
}

#sc-message-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    resize: none;
    height: 40px;
}

.sc-chat-trigger {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #0073aa;
    color: #fff;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 9998;
    transition: all 0.3s ease;
}

.sc-chat-trigger:hover {
    transform: scale(1.1);
}

.sc-unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.sc-chat-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.sc-chat-button:hover {
    background: #005a87;
}

.sc-empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* === Responsive === */
@media (max-width: 768px) {
    .sc-single-ad {
        grid-template-columns: 1fr;
    }
    
    .sc-ad-sidebar {
        grid-column: 1;
        grid-row: auto;
    }
    
    .sc-profile-dashboard {
        flex-direction: column;
    }
    
    .sc-profile-nav {
        flex: 1;
    }
    
    .sc-chat-widget {
        width: calc(100% - 40px);
        height: calc(100% - 100px);
    }
}