/* Shared styles for tool pages (HEX to RGB, HEX to Pantone, etc.) */

/* Base styles */
body {
    background: #f7fbfc;
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #333;
}
.random-header { text-align: center; margin-top: 0; }
.random-header-content { padding-top: 2rem; }
.random-subtitle { color: #7a8a99; margin-bottom: 2.5rem; font-size: 1.15rem; }

/* Dropdown styles */
.nav-dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-content {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    background-color: #fff;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 4px;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}
.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    transition: background-color 0.2s ease;
}
.dropdown-content a:hover {
    background-color: #f1f1f1;
}
.nav-dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Input with copy button */
.input-with-copy {
    display: flex;
    position: relative;
}
.input-with-copy input {
    width: 100%;
    padding: 12px;
    padding-right: 40px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.2s;
}
.copy-btn {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: color 0.2s;
}

/* Color picker */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}
.color-picker-wrapper label {
    font-weight: 600;
    color: #444;
}
#colorPicker {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}
#colorPicker::-webkit-color-swatch-wrapper {
    padding: 0;
}
#colorPicker::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

/* Color display */
.color-display {
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* HEX to RGB specific styles */
.converter-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}
.converter-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    padding: 30px;
    margin-bottom: 30px;
}
.color-preview {
    display: flex;
    margin-bottom: 30px;
}
.color-preview .color-display {
    flex: 1;
    height: 180px;
    font-size: 24px;
}
.converter-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}
.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.input-group h2 {
    font-size: 1.3rem;
    margin: 0 0 10px 0;
    color: #444;
}
.input-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #444;
}
.rgb-inputs {
    display: flex;
    gap: 10px;
    position: relative;
}
.rgb-inputs input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    text-align: center;
    transition: border-color 0.2s;
}
.additional-formats {
    margin-top: 30px;
}
.additional-formats h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #444;
}
.formats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}
.format-item {
    background: #f9f9f9;
    border-radius: 6px;
    padding: 15px;
}
.format-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #444;
    font-size: 14px;
}
.format-item .input-with-copy {
    margin-top: 5px;
}
.color-history {
    margin-top: 30px;
}
.color-history h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #444;
}
.history-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.history-color {
    width: 60px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s;
}
.history-color:hover {
    transform: translateY(-2px);
}
.history-swatch {
    height: 60px;
}
.history-info {
    padding: 5px;
    background: white;
    font-size: 10px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* HEX to Pantone specific styles */
.pantone-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
.pantone-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
}
.color-picker-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.color-picker-container .color-display {
    width: 100%;
    height: 150px;
    font-size: 20px;
}
.color-input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.color-input-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #444;
}
.color-input-group input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.2s;
}

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

@media (max-width: 768px) {
    .converter-form {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .converter-card {
        padding: 20px;
    }
    .formats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .pantone-container {
        padding: 15px;
    }
    .color-picker-container {
        padding: 15px;
    }
}
