* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    color: #1e293b;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.sidebar-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 16px;
}

.btn-icon:hover {
    background: #e2e8f0;
    color: #fff;
}

.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
}

.sidebar-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.sidebar-tab.active {
    color: #fff;
    border-bottom: 2px solid #0f4ba5;
}

.sidebar-tab:hover {
    color: #fff;
    background: #edf5ff;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.input-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-bottom: 1px solid #e2e8f0;
}

/* URL Bar */
.url-bar {
    padding: 15px;
    display: flex;
    gap: 10px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    align-items: center;
}

.url-input {
    flex: 1;
    padding: 8px 12px;
    background: #3c3c3c;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    outline: none;
}

.url-input:focus {
    border-color: #0f4ba5;
}

.fetch-btn, .save-btn, .clear-btn {
    padding: 8px 20px;
    background: #0f4ba5;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.fetch-btn:hover {
    background: #005a9e;
}

.save-btn {
    background: #3c3c3c;
    border: 1px solid #e2e8f0;
}

.save-btn:hover {
    background: #4c4c4c;
}

.clear-btn {
    background: #3c3c3c;
    border: 1px solid #f93e3e;
    color: #f93e3e;
}

.clear-btn:hover {
    background: #f93e3e;
    color: #fff;
}

/* Tabs */
.input-tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.tab.active {
    color: #fff;
    border-bottom-color: #0f4ba5;
}

.tab:hover {
    color: #fff;
    background: #edf5ff;
}

.tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Meta Grid */
.meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.meta-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meta-field.full-width {
    grid-column: 1 / -1;
}

.meta-field label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.char-count {
    font-size: 11px;
    color: #64748b;
    font-weight: normal;
}

.char-count.warning {
    color: #fca130;
}

.char-count.error {
    color: #f93e3e;
}

.meta-input, .meta-textarea, .meta-select {
    padding: 10px 12px;
    background: #3c3c3c;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.meta-input:focus, .meta-textarea:focus, .meta-select:focus {
    border-color: #0f4ba5;
}

.meta-textarea {
    resize: vertical;
    min-height: 80px;
}

.meta-select {
    cursor: pointer;
}

/* Color Picker */
.color-picker-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-picker {
    width: 50px;
    height: 40px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
}

.color-text {
    flex: 1;
}

/* Preview Section */
.preview-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
}

.preview-header {
    padding: 15px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.preview-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 10px;
}

.preview-tabs {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.preview-tab {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    color: #64748b;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.preview-tab.active {
    color: #fff;
    background: #0f4ba5;
    border-color: #0f4ba5;
}

.preview-tab:hover {
    color: #fff;
    border-color: #0f4ba5;
}

.tab-icon {
    font-size: 14px;
}

.preview-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.preview-panel {
    display: none;
}

.preview-panel.active {
    display: block;
}

/* Google Preview */
.google-preview {
    max-width: 600px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 20px;
}

.google-url {
    color: #202124;
    font-size: 14px;
    line-height: 1.3;
    margin-bottom: 8px;
}

.google-title {
    color: #1a0dab;
    font-size: 20px;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
    margin-bottom: 8px;
}

.google-title:hover {
    text-decoration: underline;
}

.google-description {
    color: #4d5156;
    font-size: 14px;
    line-height: 1.58;
}

/* Facebook Preview */
.facebook-preview {
    max-width: 500px;
    background: #fff;
    border: 1px solid #dddfe2;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.facebook-image-container {
    width: 100%;
    height: 261px;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.facebook-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.facebook-image-placeholder {
    color: #65676b;
    font-size: 14px;
}

.facebook-content {
    padding: 12px;
    background: #f0f2f5;
}

.facebook-url {
    color: #65676b;
    font-size: 12px;
    text-transform: uppercase;
    line-height: 1.3333;
    margin-bottom: 4px;
}

.facebook-title {
    color: #1c1e21;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 4px;
}

.facebook-description {
    color: #606770;
    font-size: 14px;
    line-height: 1.3333;
}

/* Twitter Preview */
.twitter-preview {
    max-width: 500px;
    background: #fff;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.twitter-image-container {
    width: 100%;
    height: 261px;
    background: #e1e8ed;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.twitter-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.twitter-image-placeholder {
    color: #657786;
    font-size: 14px;
}

.twitter-content {
    padding: 12px;
}

.twitter-title {
    color: #0f1419;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
}

.twitter-description {
    color: #536471;
    font-size: 15px;
    line-height: 1.3;
    margin-bottom: 4px;
}

.twitter-domain {
    color: #8899a6;
    font-size: 15px;
}

/* LinkedIn Preview */
.linkedin-preview {
    max-width: 520px;
    background: #fff;
    border: 1px solid #1e293b;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.linkedin-image-container {
    width: 100%;
    height: 270px;
    background: #f3f6f8;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.linkedin-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.linkedin-image-placeholder {
    color: #666;
    font-size: 14px;
}

.linkedin-content {
    padding: 16px;
}

.linkedin-title {
    color: #000;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
}

.linkedin-description {
    color: #666;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.linkedin-domain {
    color: #999;
    font-size: 12px;
}

/* Slack Preview */
.slack-preview {
    max-width: 480px;
    margin-bottom: 20px;
}

.slack-unfurl {
    display: flex;
    background: #fff;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    overflow: hidden;
}

.slack-sidebar {
    width: 4px;
    flex-shrink: 0;
}

.slack-content {
    padding: 12px;
    flex: 1;
}

.slack-title {
    color: #1d1c1d;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.46668;
    margin-bottom: 4px;
}

.slack-description {
    color: #616061;
    font-size: 15px;
    line-height: 1.46668;
    margin-bottom: 8px;
}

.slack-footer {
    display: flex;
    align-items: center;
    gap: 6px;
}

.slack-favicon {
    width: 16px;
    height: 16px;
}

.slack-domain {
    color: #616061;
    font-size: 13px;
}

/* Preview Info */
.preview-info {
    display: flex;
    gap: 30px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-label {
    font-size: 13px;
    color: #64748b;
}

.info-value {
    font-size: 13px;
    color: #fff;
}

.status-indicator {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 3px;
}

.status-indicator.good {
    background: #49cc90;
    color: #000;
}

.status-indicator.warning {
    background: #fca130;
    color: #000;
}

.status-indicator.error {
    background: #f93e3e;
    color: #fff;
}

/* Resize Handle */
.resize-handle {
    height: 6px;
    background: #e2e8f0;
    cursor: row-resize;
    display: flex;
    justify-content: center;
    align-items: center;
}

.resize-handle::after {
    content: '';
    width: 30px;
    height: 2px;
    background: #5a5a5a;
    border-radius: 1px;
}

.resize-handle:hover {
    background: #0f4ba5;
}

.resize-handle:hover::after {
    background: #fff;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #f8fafc;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #fff;
}

.modal-input {
    width: 100%;
    padding: 10px;
    background: #3c3c3c;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    margin-bottom: 15px;
    outline: none;
}

.modal-input:focus {
    border-color: #0f4ba5;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.modal-btn-primary {
    background: #0f4ba5;
    color: #fff;
}

.modal-btn-primary:hover {
    background: #005a9e;
}

.modal-btn-secondary {
    background: transparent;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.modal-btn-secondary:hover {
    background: #e2e8f0;
    color: #fff;
}

/* Saved Items */
.saved-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.2s;
}

.saved-item:hover {
    background: #edf5ff;
}

.saved-item.active {
    background: #094771;
}

.saved-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.saved-item-date {
    font-size: 11px;
    color: #64748b;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #ffffff;
}

::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4e4e52;
}

/* Responsive */
@media (max-width: 1024px) {
    .meta-grid {
        grid-template-columns: 1fr;
    }
}
