/* Main Converter Container */
.pixels-converter-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 25px;
    box-shadow: 0 25px 75px rgba(0, 0, 0, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: white;
}

.converter-header {
    text-align: center;
    margin-bottom: 40px;
}

.converter-header h2 {
    font-size: 2.8em;
    margin: 0 0 15px 0;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.converter-header .description {
    font-size: 1.2em;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

/* Converter Main Layout */
.converter-main {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 40px;
    background: white;
    padding: 40px;
    border-radius: 20px;
    color: #333;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
}

/* Input Section */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.input-group {
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 1.1em;
}

.pixels-input {
    width: 100%;
    padding: 18px;
    font-size: 1.3em;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    font-weight: 600;
}

.pixels-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.input-unit {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(18px);
    font-weight: 600;
    color: #666;
    font-size: 1.1em;
}

/* Resolution Settings */
.resolution-settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    border: 2px solid #e9ecef;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-group label {
    font-weight: 600;
    color: #444;
    font-size: 0.95em;
}

.resolution-select {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.resolution-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.custom-resolution {
    margin-top: 10px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.9em;
}

/* Conversion Type */
.conversion-type label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #444;
}

.type-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.type-btn {
    padding: 12px 20px;
    background: #e9ecef;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #495057;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
    min-width: 80px;
}

.type-btn:hover {
    background: #dee2e6;
}

.type-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Calculate Button */
.calculate-btn {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.calculate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.calc-icon {
    font-size: 1.4em;
}

/* Results Section */
.results-section h3 {
    color: #333;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
    font-size: 1.8em;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.unit-icon {
    font-size: 1.8em;
}

.result-card h4 {
    margin: 0;
    color: #333;
    font-size: 1.1em;
}

.result-value {
    font-size: 2.2em;
    font-weight: 700;
    color: #667eea;
    margin: 10px 0;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-formula {
    font-size: 0.85em;
    color: #666;
    font-family: monospace;
    background: white;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #eee;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Conversion Info */
.conversion-info {
    background: #e3f2fd;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #2196f3;
}

.conversion-info h4 {
    color: #1565c0;
    margin: 0 0 15px 0;
}

.formulas-list p {
    margin: 8px 0;
    font-family: monospace;
    font-size: 0.95em;
    color: #333;
}

/* Examples Section */
.examples-section {
    margin-top: 40px;
    padding: 40px;
    background: white;
    border-radius: 20px;
    color: #333;
}

.examples-section h3 {
    color: #333;
    margin-bottom: 25px;
    font-size: 2em;
}

.examples-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.tab-btn {
    padding: 12px 25px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-weight: 600;
    color: #495057;
    transition: all 0.3s ease;
    border-bottom: none;
}

.tab-btn:hover {
    background: #e9ecef;
}

.tab-btn.active {
    background: white;
    border-color: #667eea;
    color: #667eea;
    position: relative;
    bottom: -2px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Example Grid */
.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.example-item {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s ease;
}

.example-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.example-item h4 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.example-item p {
    color: #555;
    margin: 10px 0;
}

.example-item ul {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.example-item li {
    padding: 5px 0;
    color: #444;
    border-bottom: 1px dashed #ddd;
}

.example-item li:last-child {
    border-bottom: none;
}

.load-example {
    margin-top: 15px;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.load-example:hover {
    background: #5a6fd8;
}

/* Tables */
.conversion-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.conversion-table th {
    background: #667eea;
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.conversion-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.conversion-table tr:nth-child(even) {
    background: #f8f9fa;
}

.conversion-table tr:hover {
    background: #e3f2fd;
}

/* Converter Actions */
.converter-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}

.action-btn {
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    color: white;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.action-icon {
    font-size: 1.2em;
}

/* Widget Styles */
.pixels-widget-converter {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.widget-input {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.widget-input input,
.widget-input select {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
}

.widget-calculate {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 15px;
}

.widget-calculate:hover {
    background: #5a6fd8;
}

.widget-results {
    display: grid;
    gap: 10px;
}

.widget-result {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.widget-unit {
    font-weight: 600;
    color: #333;
}

.widget-value {
    color: #667eea;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 992px) {
    .converter-main {
        grid-template-columns: 1fr;
    }
    
    .results-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .pixels-converter-container {
        padding: 20px;
    }
    
    .converter-main {
        padding: 25px;
    }
    
    .converter-header h2 {
        font-size: 2em;
    }
    
    .resolution-settings {
        grid-template-columns: 1fr;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .type-buttons {
        flex-direction: column;
    }
    
    .converter-actions {
        flex-direction: column;
    }
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.result-pulse {
    animation: pulse 0.5s ease;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .pixels-converter-container {
        background: linear-gradient(135deg, #2c3e50 0%, #4a235a 100%);
    }
    
    .converter-main,
    .examples-section {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .pixels-input,
    .resolution-select,
    .custom-resolution {
        background: #34495e;
        border-color: #4a6278;
        color: #ecf0f1;
    }
    
    .result-card,
    .example-item {
        background: #34495e;
        border-color: #4a6278;
        color: #ecf0f1;
    }
}