/* Video Content Organizer - Stylesheet */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 10px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

header h1 {
    color: #667eea;
    font-size: 1.5em;
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.subtitle {
    display: none; /* Hide subtitle for minimal header */
}

nav {
    margin: 0;
}

nav a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-block;
    transition: all 0.2s;
    font-size: 0.9em;
    border: 1px solid #667eea;
}

nav a:hover {
    background: #667eea;
    color: white;
}

/* Form Styles */
.form-section, .filter-section, .search-section {
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(to bottom, #f8f9fa, #ffffff);
    border-radius: 10px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.form-section h2, .search-section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.5em;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
}

.optional {
    font-weight: normal;
    color: #95a5a6;
    font-size: 0.9em;
}

input[type="text"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s;
    background: white;
}

input[type="text"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-clear {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

.btn-clear {
    background: #e74c3c;
    color: white;
    margin-left: 10px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.btn-clear:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

/* Filter Form */
.filter-form, .search-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.search-group input,
.search-group select {
    flex: 1;
    min-width: 200px;
}

.search-group input[type="text"] {
    flex: 2;
    min-width: 250px;
}

/* Content Grid */
.content-section, .results-section {
    margin-top: 40px;
}

.content-section h2, .results-section h2 {
    margin-bottom: 25px;
    color: #2c3e50;
    font-size: 1.8em;
    font-weight: 600;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.content-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.content-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.category-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.category-cooking {
    background: #ffeaa7;
    color: #d63031;
}

.category-travel {
    background: #a8e6cf;
    color: #00b894;
}

.category-project {
    background: #c7ecee;
    color: #0984e3;
}

.category-diy {
    background: #dfe6e9;
    color: #636e72;
}

.category-tutorial {
    background: #fdcb6e;
    color: #e17055;
}

.category-entertainment {
    background: #fab1a0;
    color: #e84393;
}

.category-other {
    background: #ddd;
    color: #666;
}

.type-badge {
    padding: 4px 10px;
    background: #ecf0f1;
    color: #34495e;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
}

.date {
    color: #95a5a6;
    font-size: 0.9em;
}

.card-body h3 {
    margin-bottom: 12px;
}

.card-body h3 a {
    color: #2c3e50;
    text-decoration: none;
    font-size: 1.2em;
}

.card-body h3 a:hover {
    color: #3498db;
    text-decoration: underline;
}

.description {
    color: #555;
    margin-bottom: 15px;
    line-height: 1.6;
}

.ai-summary {
    background: #f8f9fa;
    padding: 15px;
    border-left: 4px solid #3498db;
    margin: 15px 0;
    border-radius: 4px;
}

.ai-summary strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 8px;
}

.extracted-content {
    margin: 15px 0;
    padding: 15px;
    background: #fff9e6;
    border-radius: 4px;
    border-left: 4px solid #f39c12;
}

.extracted-content strong {
    color: #e67e22;
    display: block;
    margin-bottom: 10px;
}

.extracted-content ul,
.extracted-content ol {
    margin-left: 20px;
    color: #555;
}

.extracted-content li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Message */
.message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    display: none;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #95a5a6;
}

.empty-state p {
    font-size: 1.2em;
}

/* Additional styles for new features */
.nav-section {
    margin: 25px 0;
    text-align: center;
}

.btn-large {
    padding: 14px 28px;
    font-size: 1em;
    font-weight: 600;
}

.card-cover {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    background: #f5f5f5;
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.truncated {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Fix URL wrapping */
a {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Enhanced card styling */
.content-card {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.content-card * {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

input[type="file"] {
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 4px;
    width: 100%;
}

small {
    display: block;
    color: #7f8c8d;
    font-size: 0.9em;
    margin-top: 5px;
}

/* Responsive - Mobile First */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }
    
    .container {
        padding: 15px;
        border-radius: 8px;
    }
    
    header {
        margin-bottom: 20px;
        padding-bottom: 12px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    header h1 {
        font-size: 1.3em;
        margin-bottom: 8px;
    }
    
    nav {
        width: 100%;
    }
    
    nav a {
        display: block;
        text-align: center;
        width: 100%;
        padding: 10px;
    }
    
    .form-section, .filter-section, .search-section {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    .form-section h2, .search-section h2 {
        font-size: 1.4em;
        margin-bottom: 15px;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .search-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-group input,
    .search-group select {
        width: 100%;
        min-width: auto;
    }
    
    input[type="text"],
    input[type="url"],
    textarea,
    select {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn-primary, .btn-secondary, .btn-clear {
        width: 100%;
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .btn-primary:last-child,
    .btn-secondary:last-child,
    .btn-clear:last-child {
        margin-bottom: 0;
    }
    
    .content-card {
        padding: 15px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* iPhone specific optimizations */
@media (max-width: 480px) {
    body {
        padding: 0;
    }
    
    .container {
        padding: 12px;
        border-radius: 0;
        min-height: 100vh;
    }
    
    header {
        padding-bottom: 10px;
        margin-bottom: 15px;
    }
    
    header h1 {
        font-size: 1.2em;
    }
    
    .form-section, .filter-section, .search-section {
        padding: 15px 12px;
    }
    
    .content-section h2, .results-section h2 {
        font-size: 1.3em;
        margin-bottom: 15px;
    }
}

