/* Teleprompter Pro - Main Stylesheet */
/* Based on UI Design System */

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

/* Feather Icons */
.feather {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    vertical-align: middle;
}

.feather-sm {
    width: 16px;
    height: 16px;
}

.feather-lg {
    width: 24px;
    height: 24px;
}

.icon-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: #F8F9FA;
    color: #24292E;
    line-height: 1.5;
}

/* Layout Components */
.main-container {
    background: #F8F9FA;
    padding: 0px;
    border-radius: 12px;
    overflow: hidden;
    min-height: 100vh;
}

.sidebar {
    background: #FFFFFF;
    border-right: 1px solid #E1E4E8;
    width: 280px;
    padding: 16px 0px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.main-content {
    background: #FFFFFF;
    padding: 24px;
    border-radius: 0px;
    margin-left: 280px;
}

/* Typography */
h1 {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    color: #24292E;
    margin-bottom: 16px;
}

h2 {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    color: #24292E;
    margin-bottom: 12px;
}

h3 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: #24292E;
    margin-bottom: 8px;
}

p {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: #24292E;
    margin-bottom: 12px;
}

.small-text {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    color: #586069;
}

.caption {
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
    color: #8B949E;
}

/* Navigation */
.nav-item {
    background: transparent;
    padding: 8px 16px;
    border-radius: 6px;
    margin: 2px 12px;
    color: #586069;
    text-decoration: none;
    display: block;
    transition: all 150ms ease-out;
}

.nav-item:hover {
    background: #F3F4F6;
    color: #24292E;
    text-decoration: none;
}

.nav-item.active {
    background: #E8F4FD;
    color: #4A90E2;
    border-left: 3px solid #4A90E2;
}

/* Cards */
.card {
    background: #FFFFFF;
    border: 1px solid #E1E4E8;
    border-radius: 12px;
    padding: 24px;
    margin: 16px 0px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 150ms ease-out;
}

.card:hover {
    background: #F8F9FA;
    border: 1px solid #D0D7DE;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card.unread {
    background: #FFFFFF;
    border: 1px solid #4A90E2;
    border-left: 4px solid #4A90E2;
}

.script-card {
    position: relative;
    overflow: hidden;
}

.script-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.script-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #24292E;
    margin: 0;
    line-height: 1.3;
}

.script-card-id {
    background: #E8F4FD;
    color: #4A90E2;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    min-width: 32px;
    text-align: center;
}

.script-card-preview {
    color: #586069;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
    min-height: 60px;
}

.script-card-meta {
    font-size: 12px;
    color: #8B949E;
    margin-bottom: 20px;
    line-height: 1.4;
}

.script-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.script-card-actions .btn {
    flex: 0 0 auto;
    font-size: 13px;
    padding: 8px 12px;
}

.script-card-actions .btn-primary {
    order: 1;
}

.script-card-actions .btn-secondary {
    order: 2;
}

.script-card-actions .btn-ghost {
    order: 3;
}

.script-card-actions .btn-danger {
    order: 4;
    margin-left: auto;
}

/* Buttons */
.btn {
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 150ms ease-out;
    text-align: center;
}

.btn-primary {
    background: #4A90E2;
    color: #FFFFFF;
}

.btn-primary:hover {
    background: #2E5C8A;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.btn-secondary {
    background: transparent;
    color: #4A90E2;
    border: 1px solid #4A90E2;
}

.btn-secondary:hover {
    background: #E8F4FD;
    border: 1px solid #2E5C8A;
    color: #2E5C8A;
}

.btn-ghost {
    background: transparent;
    color: #586069;
    border: none;
}

.btn-ghost:hover {
    background: #F3F4F6;
    color: #24292E;
}

.btn-danger {
    background: #D0021B;
    color: #FFFFFF;
}

.btn-danger:hover {
    background: #B5001A;
}

/* Form Elements */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #24292E;
}

.form-input, .form-textarea, .form-select {
    background: #FFFFFF;
    border: 1px solid #E1E4E8;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    color: #24292E;
    width: 100%;
    transition: all 200ms ease-in-out;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    border: 2px solid #4A90E2;
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-input::placeholder, .form-textarea::placeholder {
    color: #8B949E;
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* Search Bar */
.search-container {
    background: #F8F9FA;
    border: 1px solid #E1E4E8;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 12px 16px;
    display: flex;
    align-items: center;
}

.search-input {
    background: transparent;
    border: none;
    color: #24292E;
    font-size: 14px;
    flex: 1;
    outline: none;
}

.search-input::placeholder {
    color: #8B949E;
}

.search-icon {
    color: #8B949E;
    margin-right: 8px;
}

/* Toolbar */
.toolbar {
    background: #F8F9FA;
    border-bottom: 1px solid #E1E4E8;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toolbar-button {
    background: transparent;
    border: none;
    color: #586069;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 150ms ease-out;
}

.toolbar-button:hover {
    background: #E1E4E8;
    color: #24292E;
}

.toolbar-button.active {
    background: #4A90E2;
    color: #FFFFFF;
}

.toolbar-button.active:hover {
    background: #2E5C8A;
}

/* Status Badges */
.badge {
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.badge-unread {
    background: #4A90E2;
    color: #FFFFFF;
}

.badge-priority {
    background: #F5A623;
    color: #FFFFFF;
}

.badge-error {
    background: #D0021B;
    color: #FFFFFF;
}

/* Context Menu */
.context-menu {
    background: #FFFFFF;
    border: 1px solid #E1E4E8;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    position: absolute;
    z-index: 1000;
}

.context-menu-item {
    background: transparent;
    color: #24292E;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    cursor: pointer;
    transition: background 150ms ease-out;
}

.context-menu-item:hover {
    background: #F3F4F6;
}

.context-menu-divider {
    height: 1px;
    background: #E1E4E8;
    margin: 8px 0px;
}

/* Responsive Grid */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.scripts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }

.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.p-8 { padding: 32px; }

.flex { display: flex; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

.w-full { width: 100%; }
.h-full { height: 100%; }

/* Teleprompter Specific Styles */
.teleprompter-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    color: #fff;
    font-family: Arial, sans-serif;
    overflow: hidden;
    z-index: 9999;
}

.teleprompter-content {
    position: absolute;
    top: 100vh;
    left: 0;
    width: 100%;
    padding: 50px;
    box-sizing: border-box;
    text-align: center;
    white-space: pre-wrap;
    line-height: 1.6;
}

.teleprompter-content.mirror {
    transform: scaleX(-1);
}

.teleprompter-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 16px;
    border-radius: 8px;
    display: flex;
    gap: 12px;
    z-index: 10000;
}

.control-button {
    background: #4A90E2;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.control-button:hover {
    background: #2E5C8A;
}

.control-slider {
    background: transparent;
    margin: 0 8px;
}

/* Remote Control Styles */
.remote-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 24px;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.remote-header {
    text-align: center;
    margin-bottom: 24px;
}

.remote-header h1 {
    color: #24292E;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.remote-header h2 {
    color: #4A90E2;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.remote-controls {
    margin-bottom: 24px;
}

.remote-controls h3 {
    color: #24292E;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
}

.remote-button {
    width: 100%;
    padding: 16px;
    margin: 8px 0;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 200ms ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.remote-button.play {
    background: linear-gradient(135deg, #7ED321 0%, #5CB85C 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(126, 211, 33, 0.3);
}

.remote-button.play:hover {
    background: linear-gradient(135deg, #5CB85C 0%, #4A9E4A 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(126, 211, 33, 0.4);
}

.remote-button.pause {
    background: linear-gradient(135deg, #F5A623 0%, #E67E22 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 166, 35, 0.3);
}

.remote-button.pause:hover {
    background: linear-gradient(135deg, #E67E22 0%, #D35400 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.4);
}

.remote-button.stop {
    background: linear-gradient(135deg, #D0021B 0%, #C0392B 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(208, 2, 27, 0.3);
}

.remote-button.stop:hover {
    background: linear-gradient(135deg, #C0392B 0%, #A93226 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(208, 2, 27, 0.4);
}

.remote-button.secondary {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.remote-button.secondary:hover {
    background: linear-gradient(135deg, #357ABD 0%, #2E5C8A 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

.remote-button.ghost {
    background: transparent;
    color: #586069;
    border: 1px solid #E1E4E8;
    box-shadow: none;
}

.remote-button.ghost:hover {
    background: #F3F4F6;
    color: #24292E;
    border-color: #D0D7DE;
    transform: translateY(-1px);
}

.speed-control {
    margin: 24px 0;
    text-align: center;
}

.speed-display {
    font-size: 24px;
    font-weight: 700;
    color: #4A90E2;
    margin-bottom: 12px;
}

.speed-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #E1E4E8;
    outline: none;
    margin: 16px 0;
    -webkit-appearance: none;
}

.speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.speed-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.speed-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #586069;
    margin-top: 8px;
}

/* Login Form */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-form {
    margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    
    .card {
        padding: 20px;
        margin: 12px 0px;
    }
    
    .toolbar {
        padding: 8px 16px;
    }
    
    .grid-2, .grid-3, .grid-4, .scripts-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .script-card-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .script-card-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .script-card-actions .btn-danger {
        margin-left: 0;
        order: 5;
    }
    
    .remote-container {
        padding: 16px;
    }
    
    .teleprompter-content {
        padding: 20px;
    }
    
    .teleprompter-controls {
        bottom: 10px;
        left: 10px;
        right: 10px;
        transform: none;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .scripts-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .card {
        padding: 16px;
    }
    
    .script-card-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .script-card-id {
        align-self: flex-end;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: 250px;
    }
    
    .main-content {
        margin-left: 250px;
    }
    
    .scripts-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 20px;
    }
}

/* Dark Theme */
body.dark-theme {
    background-color: #24292E;
    color: #FFFFFF;
}

body.dark-theme .main-container {
    background: #24292E;
}

body.dark-theme .sidebar {
    background: #1F2428;
    border-right: 1px solid #30363D;
}

body.dark-theme .main-content {
    background: #24292E;
}

body.dark-theme .card {
    background: #30363D;
    border: 1px solid #30363D;
    color: #FFFFFF;
}

body.dark-theme .form-input,
body.dark-theme .form-textarea,
body.dark-theme .form-select {
    background: #30363D;
    border: 1px solid #30363D;
    color: #FFFFFF;
}

body.dark-theme .teleprompter-container {
    background: #24292E;
}

/* Connection Status */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-indicator.connected {
    background: #7ED321;
    box-shadow: 0 0 8px rgba(126, 211, 33, 0.5);
}

.status-indicator.disconnected {
    background: #D0021B;
    box-shadow: 0 0 8px rgba(208, 2, 27, 0.5);
}

/* Loading States */
.loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid rgba(74, 144, 226, 0.2);
    border-top-color: #4A90E2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error Pages */
.error-container {
    max-width: 500px;
    margin: 100px auto;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.error-header {
    margin-bottom: 32px;
}

.error-icon {
    width: 64px;
    height: 64px;
    color: #D0021B;
    margin-bottom: 16px;
}

.error-header h1 {
    font-size: 32px;
    color: #24292E;
    margin: 0 0 8px;
}

.error-header p {
    font-size: 16px;
    color: #586069;
    margin: 0;
}

.error-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.error-actions .btn {
    min-width: 120px;
} 